public void FastForwardButton_Click(object sender, EventArgs e) { currentSong = incSongs[random.Next(incSongs.Count - 1)]; NowPlayingText.Text = String.Format("Now Playing: {0} - {1}", currentSong.artist, currentSong.title); BackgroundImage.ImageLocation = currentSong.bgArt; musicPlayer.NextSong(currentSong); }
public void PlaySong(song song) { if (audioFile == null && oggReader == null) { currentSong = song; if (song.isOgg) { oggReader = new VorbisWaveReader(song.songDir); audioOutput.Init(oggReader); } else { audioFile = new AudioFileReader(song.songDir); audioOutput.Init(audioFile); } audioOutput.Play(); } else { audioOutput.Play(); } }
private void PlayPauseButton_Click(object sender, EventArgs e) { if (incSongs != null) { if (currentSong == null) { currentSong = incSongs[random.Next(incSongs.Count - 1)]; NowPlayingText.Text = String.Format("Now Playing: {0} - {1}", currentSong.artist, currentSong.title); BackgroundImage.ImageLocation = currentSong.bgArt; } if (songPlaying) { PlayPauseButton.Image = Properties.Resources.play_button; songPlaying = false; musicPlayer.PauseSong(); } else { PlayPauseButton.Image = Properties.Resources.pause; songPlaying = true; musicPlayer.PlaySong(currentSong); } } }
public void NextSong(song song) { StopSong(); PlaySong(song); }