Beispiel #1
0
 public void previousSong() {
   m_provider.previousSong();
   Song song = m_provider.getCurrentSong();
   if (m_isPlaying) {
     m_player.pause();
   }
   m_player.setSong(song);
   if (m_isPlaying) {
     m_player.play();
   }
   m_currentSong = song;
   notifySongChanged(song);
 }
Beispiel #2
0
 public Engine(SongProvider provider, Player player) {
   m_listeners = new HashSet<UpdateListener>();
   m_provider = provider;
   m_player = player;
   m_isPlaying = false;
   m_currentSong = m_provider.getCurrentSong();
   m_player.setSong(m_currentSong);
   m_player.addListener(
       new Player.SongFinishedListener() {
         public void onSongFinished() {
           nextSong();
         }
       });
 }