Exemplo n.º 1
0
 public void run() {
   // Play song
   System.out.println("Playing song: " + song);
   songQueue.add(new File(song));
   musicHome.refreshQueue();
   musicPlayer.setSong(songQueue.remove(0));
   musicHome.refreshQueue();
   if (!musicPlayer.isPlaying()) {
     musicPlayer.play(-1);
   }
   t.cancel();
 }
Exemplo n.º 2
0
    public void run() {
      list.load(musicHome.getMusicDirectory().getAbsolutePath() + "/" + list.getName());
      // add all songs in Playlist to queue, refresh, and play
      for (int i = 0; i < list.getSize(); i++) {
        list.setPosition(i);
        songQueue.add(new File(list.getCurrentSong()));
      }
      musicHome.refreshQueue();
      musicPlayer.setSong(songQueue.remove(0));
      musicHome.refreshQueue();
      if (!musicPlayer.isPlaying()) {
        musicPlayer.play(-1);
      }

      t.cancel();
    }