private void addPlaylist_Click(object sender, EventArgs e)
        {
            OpenFileDialog selectFileDialog = new OpenFileDialog();

            selectFileDialog.Filter = "Playlist Files|*.xspf;*.asx;*.wax;*.wvx;*.b4s;*.m3u;*.m3u8;*.pls;*.smil;*.smi;*.zpl;";
            {
                if (selectFileDialog.ShowDialog() == DialogResult.OK)
                {
                    IPlaylistIO theReader = PlaylistIOFactory.GetInstance().GetPlaylistIO(selectFileDialog.FileName);
                    try
                    {
                        foreach (string s in theReader.FilePaths)
                        {
                            PlayerForm.AddQueue(s);
                        }
                        listBox1.Items.Clear();
                        PopulateList();
                    }
                    catch (System.IO.DirectoryNotFoundException)
                    {
                        MessageBox.Show("This playlist file cannot be played because one or more of the songs could not be found.", "Songs not found", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        PlayerForm.ClearQueue();
                    }
                }
            }
        }
Exemple #2
0
 private async void BrowsePlaylist()
 {
     using (OpenFileDialog selectFileDialog = new OpenFileDialog())
     {
         selectFileDialog.Filter = "Playlist Files|*.xspf;*.asx;*.wax;*.wvx;*.b4s;*.m3u;*.m3u8;*.pls;*.smil;*.smi;*.zpl;";
         {
             if (selectFileDialog.ShowDialog() == DialogResult.OK)
             {
                 IPlaylistIO theReader = PlaylistIOFactory.GetInstance().GetPlaylistIO(selectFileDialog.FileName);
                 try
                 {
                     if (AddTrackCheckBox.Checked)
                     {
                         DatabaseHandler.ImportSong(theReader.FilePaths);
                     }
                     foreach (string s in theReader.FilePaths)
                     {
                         PlayerForm.AddQueue(s);
                     }
                     LibraryNeedsUpdating = true;
                     PlayerForm.PlayMusic();
                     await UpdateLibrary();
                 }
                 catch (DirectoryNotFoundException)
                 {
                     MessageBox.Show("This playlist file cannot be played because one or more of the songs could not be found.", "Songs not found", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     PlayerForm.ClearQueue();
                 }
             }
         }
     }
 }
 private void clearQueue_Click(object sender, EventArgs e)
 {
     PlayerForm.ClearQueue();
     listBox1.Items.Clear();
     PopulateList();
 }
 private void stopButton_Click(object sender, EventArgs e)
 {
     PlayerForm.ClearQueue();
     PlayerForm.StopMusic();
 }
Exemple #5
0
 private static void StopButton()
 {
     PlayerForm.ClearQueue();
     PlayerForm.StopMusic();
 }