samedi 24 octobre 2015

playing track in random order java

do I on the right track? this must play every track in arraylist once in random order.

public void randomAllTrack() { 

    int shuffle = getNumberOfTracks();
    int shuffleplay = randomTrack.nextInt(shuffle);
    Track track = tracks.get(shuffleplay);
    int i=0;

    while(i < getNumberOfTracks())
    {player.startPlaying(track.getFilename());
        System.out.println("Now playing: " + track.getArtist() + " - "
        + track.getTitle());
        i++;}
}




Aucun commentaire:

Enregistrer un commentaire