Exemplo n.º 1
0
        private void btnOpenFiles(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = "MP3 files (*.mp3)|*.mp3|All files (*.*)|*.*";
            if (openFileDialog.ShowDialog() == true)
            {
                //audioPlayer.Open(new Uri(openFileDialog.FileName));
                //audioPlayer.Play();
                Track tempSound = new Track();
                tempSound.TrackPath = openFileDialog.FileName;
                tempSound.TrackName = openFileDialog.FileName.Split('\\')[openFileDialog.FileName.Split('\\').Length-1];

                MessageBox.Show("Файл \"" + tempSound.TrackName + "\" був добавлений до плейлису.", "Операція успішна", MessageBoxButton.OK, MessageBoxImage.Information);

                PlayList.AddSoundToList(tempSound);

                lstbTrackList.Items.Clear();

                foreach (Track track in PlayList.GetPlayList())
                {
                    lstbTrackList.Items.Add(track.TrackName);
                }
            }
        }
Exemplo n.º 2
0
 public static void AddSoundToList(Track addingsound)
 {
     list.Add(addingsound);
 }