@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(); } }
@Override public void stopTrack() { try { isPlaying = false; playlist.begin(); player.stop(); } catch (BasicPlayerException ex) { ex.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }
@Override public void playPreviousTrack() { playlist.previousCursor(); isPlaying = false; playTrack(); }
@Override public void playNextTrack() { playlist.nextCursor(); isPlaying = false; playTrack(); }