Beispiel #1
0
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MediaPlayer.Ctlcontrols.stop();
            string    currentTitle = playlistListBox.SelectedItem.ToString(); // current list box item selected
            SongModel song         = MediaPlayerHelper.GetSelectedSong(currentTitle, songs);

            songs.Remove(song); // remove song
            MediaPlayer.currentPlaylist.clear();
            playlistListBox.Items.Clear();

            foreach (SongModel songItems in songs)
            {
                MediaPlayer.currentPlaylist.appendItem(songItems.MediaFile);
                playlistListBox.Items.Add(songItems.MediaFile.getItemInfo("Title"));
            }

            if (playListLabel.Text != "Unsaved Playlist")                                                                // check if saved playlist needs to be modified as well
            {
                IWMPPlaylist playlistForDeletion = MediaPlayer.playlistCollection.getByName(playListLabel.Text).Item(0); // find old playlist for deletion
                MediaPlayer.playlistCollection.remove(playlistForDeletion);                                              // delete selected playlist

                // save current updated playlist
                playlist      = MediaPlayer.currentPlaylist;
                playlist.name = playListLabel.Text;
                MediaPlayer.playlistCollection.importPlaylist(playlist); // adds playlist to library
            }
            MediaPlayer.Ctlcontrols.play();
        }
Beispiel #2
0
        // handles selection changes in playlist
        private void PlaylistListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            // gets the song selected in playlist
            string    currentTitle = playlistListBox.SelectedItem.ToString();
            SongModel song         = MediaPlayerHelper.GetSelectedSong(currentTitle, songs);

            webBrowserLyrics.AllowNavigation = true;
            defaultPage = MediaPlayerHelper.CheckURL(song, webBrowserLyrics); // checks if link URL found
        }