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); } } }
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); } } }
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); } }
public void Play(Powerhour Powerhour) { powerhourEngine.Start(Powerhour); }
void SetCurrentPowerhour(Powerhour Powerhour) { CurrentPowerhour = Powerhour; dgPowerhourView.ItemsSource = Powerhour.SongSamples; }
public void Start(Powerhour Powerhour) { currentPowerhour = Powerhour; currentSongIndex = 0; songTime = 0; PlaySong(currentSong); timer.Start(); }