Example #1
0
        private void OpenFolderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();

            if (fbd.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            UrlToIndex.Clear();
            ClearGui();
            var files = Directory.GetFiles(fbd.SelectedPath).ToList();

            OpenMusicFiles(files.Where(IsSong).ToArray());
        }
Example #2
0
        private void MainForm_PlayListPlayClicked(object sender, PlaylistPlayClickedEventArgs e)
        {
            Focus();
            ClearGui();
            UrlToIndex.Clear();
            List <MusicFile> musicFiles = new List <MusicFile>();

            e.SongsToBePlayed.ForEach(song =>
            {
                MusicFile mf = new MusicFile(song);
                musicFiles.Add(mf);
                lbOpenedFiles.Items.Add(mf);
                UrlToIndex.Add(mf.Url, lbOpenedFiles.Items.Count - 1);
            });
            Player.PlayMusicFiles(musicFiles, true);
        }
Example #3
0
        private void OpenMusicFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog
            {
                Filter =
                    @"All files (*.flac, *.mp3, *.wav)|*.flac;*.mp3;*.wav|Mp3 files(*.mp3)|*.mp3|Flac files (*.flac)|*.flac|Wav files (*.wav)|*.wav",
                Title = @"Open Music"
            };

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            UrlToIndex.Clear();
            ClearGui();
            OpenMusicFile(ofd.FileName);
        }