Exemplo n.º 1
0
        public void RemoveSongs(Powerhour CurrentPowerhour, IEnumerable<SongSample> songSamples)
        {
            var confirmationResult = MessageBox.Show("Are you sure you wish to remove these songs?", "Confirmation", MessageBoxButton.OKCancel);

            if (confirmationResult == MessageBoxResult.OK) {

                foreach (var song in songSamples) {
                    CurrentPowerhour.SongSamples.Remove(song);
                }
            }
        }
Exemplo n.º 2
0
        public void AddSongs(Powerhour Powerhour)
        {
            var openFilesDialog = new OpenFileDialog {
                Filter = "MP3 (.mp3)|*.mp3",
                Multiselect = true
            };

            if (openFilesDialog.ShowDialog() == true) {

                foreach (var file in openFilesDialog.Files) {

                    var song = new Song(file.FullName);
                    var songSample = new SongSample(song);
                    Powerhour.SongSamples.Add(songSample);
                }
            }
        }
Exemplo n.º 3
0
        public void MoveSongsUp(Powerhour CurrentPowerhour, IEnumerable<SongSample> songSamples)
        {
            if (songSamples.Any(s => CurrentPowerhour.SongSamples.First() == s)) {
                MessageBox.Show("Cannot move up when first song is selected.");
                return;
            }

            // TODO: this is a cheat - will fail if a song in more than once
            var indexedSongSamples = songSamples
                .Select(s => new {
                    Song = s,
                    Index = CurrentPowerhour.SongSamples.IndexOf(s)
                })
                .OrderBy(s => s.Index);

            foreach (var indexedSong in indexedSongSamples) {
                CurrentPowerhour.SongSamples.RemoveAt(indexedSong.Index);
                CurrentPowerhour.SongSamples.Insert(indexedSong.Index - 1, indexedSong.Song);
            }
        }
Exemplo n.º 4
0
 public void Play(Powerhour Powerhour)
 {
     powerhourEngine.Start(Powerhour);
 }
Exemplo n.º 5
0
 void SetCurrentPowerhour(Powerhour Powerhour)
 {
     CurrentPowerhour = Powerhour;
     dgPowerhourView.ItemsSource = Powerhour.SongSamples;
 }
Exemplo n.º 6
0
        public void Start(Powerhour Powerhour)
        {
            currentPowerhour = Powerhour;
            currentSongIndex = 0;
            songTime = 0;
            PlaySong(currentSong);

            timer.Start();
        }