public void wplayer_PlayStateChange(int NewState) { if (wplayer.playState == WMPLib.WMPPlayState.wmppsMediaEnded) { SkipForward(); wplayer.URL = Songlist.SelectedItem.ToString(); Songlist.ScrollIntoView(Songlist.SelectedItem); Durationlbl.Content = wplayer.currentMedia.durationString; Volumebar.Value = wplayer.settings.volume; Titlelbl.Content = wplayer.currentMedia.getItemInfo("Title"); Songtrigger.IsEnabled = true; } }
private void skipbackbutton(object sender, RoutedEventArgs e) { if (wplayer != null) { if (Songlist.SelectedIndex > 0) { Songlist.ScrollIntoView(Songlist.SelectedItem); Songlist.SelectedIndex = Songlist.SelectedIndex - 1; wplayer.URL = Songlist.SelectedItem.ToString(); Durationlbl.Content = wplayer.currentMedia.durationString; Titlelbl.Content = wplayer.currentMedia.getItemInfo("Title"); wplayer.controls.play(); } } }
private void skipbutton(object sender, RoutedEventArgs e) { try { SkipForward(); wplayer.URL = Songlist.SelectedItem.ToString(); Songlist.ScrollIntoView(Songlist.SelectedItem); Durationlbl.Content = wplayer.currentMedia.durationString; Titlelbl.Content = wplayer.currentMedia.getItemInfo("Title"); wplayer.controls.play(); if (Songlist.SelectedIndex > Songlist.Items.Count - 1) { Songlist.SelectedIndex = -1; } } catch { Titlelbl.Content = "no"; } }