예제 #1
0
 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);
 }
예제 #2
0
 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();
     }
 }
예제 #3
0
 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);
         }
     }
 }
예제 #4
0
 public void NextSong(song song)
 {
     StopSong();
     PlaySong(song);
 }