public final class Playlist
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BACKWARDS
This const represents a way in which a sound will be picked from the list.
|
static int |
FORWARDS
This const represents a way in which a sound will be picked from the list.
|
private int |
num |
private int |
pickMode |
static int |
PLAY_ALL
This const represents a way in which successive sounds can be played.
|
static int |
PLAY_ONE
This const represents a way in which successive sounds can be played.
|
private int[] |
playedSounds |
static int |
REPEAT_ALL
This const represents a way in which successive sounds can be played.
|
static int |
REPEAT_ONE
This const represents a way in which successive sounds can be played.
|
private int |
repeatMode |
static int |
SHUFFLE
This const represents a way in which a sound will be picked from the list.
|
private java.io.File[] |
soundFiles |
| Constructor and Description |
|---|
Playlist(java.io.File... soundFiles)
The constructor to use.
|
Playlist(java.io.File[] soundFiles,
int repeatMode,
int pickMode)
The constructor to use.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Returns false if this Playlist is exhausted, true otherwise.
|
java.io.File |
next()
Returns the next sound file on this Playlist or null if there is no such sound.
|
void |
setPickMode(int pickMode)
Sets the pick-mode for this playlist.
|
void |
setRepeatMode(int repeatMode)
Sets the repeat-mode for this playlist.
|
public static final int PLAY_ALL
public static final int REPEAT_ALL
public static final int PLAY_ONE
public static final int REPEAT_ONE
public static final int FORWARDS
public static final int BACKWARDS
public static final int SHUFFLE
private final java.io.File[] soundFiles
private int num
private int repeatMode
private int pickMode
private final int[] playedSounds
public Playlist(java.io.File... soundFiles)
soundFiles - The sounds that will make up this Playlist. The order of the sounds is important.public Playlist(java.io.File[] soundFiles,
int repeatMode,
int pickMode)
soundFiles - The sounds that will make up this Playlist. The order of the sounds may be important.repeatMode - Determines how, which and if songs will be repeated. Should be one of {PLAY_ALL, REPEAT_ALL, PLAY_ONE, REPEAT_ONE}.pickMode - The way in which sounds will be picked from the list. Should be one of {FORWARDS, BACKWARDS, SHUFFLE}.public void setRepeatMode(int repeatMode)
repeatMode - The method this PlayList
should be repeated.public void setPickMode(int pickMode)
pickMode - The method to be used for picking
the songs.public java.io.File next()
public boolean hasNext()