コード例 #1
0
 @Override
 public void playTrack() {
   try {
     int index = playlist.getSelectedIndex();
     if (index < playlist.getPlaylistSize()) {
       if (player.isPlaying()) {
         player.stop();
       }
       player.play(playlist.getCursor().getFullName());
     }
   } catch (BasicPlayerException ex) {
     ex.printStackTrace();
     playNextTrack();
   }
 }
コード例 #2
0
 @Override
 public void stopTrack() {
   try {
     isPlaying = false;
     playlist.begin();
     player.stop();
   } catch (BasicPlayerException ex) {
     ex.printStackTrace();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
コード例 #3
0
 @Override
 public void playPreviousTrack() {
   playlist.previousCursor();
   isPlaying = false;
   playTrack();
 }
コード例 #4
0
 @Override
 public void playNextTrack() {
   playlist.nextCursor();
   isPlaying = false;
   playTrack();
 }