net.sf.freecol.client.gui.sound
Class Playlist

java.lang.Object
  extended by net.sf.freecol.client.gui.sound.Playlist

public final class Playlist
extends java.lang.Object

Represent a set of sounds that will be presented to a SoundPlayer in a certain order as defined by the Playlists playmodes.


Field Summary
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.
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.
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.
static int SHUFFLE
          This const represents a way in which a sound will be picked from the list.
 
Constructor Summary
Playlist(java.io.File... soundFiles)
          The constructor to use.
Playlist(java.io.File[] soundFiles, int repeatMode, int pickMode)
          The constructor to use.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAY_ALL

public static final int PLAY_ALL
This const represents a way in which successive sounds can be played.

See Also:
Constant Field Values

REPEAT_ALL

public static final int REPEAT_ALL
This const represents a way in which successive sounds can be played.

See Also:
Constant Field Values

PLAY_ONE

public static final int PLAY_ONE
This const represents a way in which successive sounds can be played.

See Also:
Constant Field Values

REPEAT_ONE

public static final int REPEAT_ONE
This const represents a way in which successive sounds can be played.

See Also:
Constant Field Values

FORWARDS

public static final int FORWARDS
This const represents a way in which a sound will be picked from the list.

See Also:
Constant Field Values

BACKWARDS

public static final int BACKWARDS
This const represents a way in which a sound will be picked from the list.

See Also:
Constant Field Values

SHUFFLE

public static final int SHUFFLE
This const represents a way in which a sound will be picked from the list.

See Also:
Constant Field Values
Constructor Detail

Playlist

public Playlist(java.io.File... soundFiles)
The constructor to use. All songs will be played once, in order.

Parameters:
soundFiles - The sounds that will make up this Playlist. The order of the sounds is important.

Playlist

public Playlist(java.io.File[] soundFiles,
                int repeatMode,
                int pickMode)
The constructor to use.

Parameters:
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}.
Method Detail

setRepeatMode

public void setRepeatMode(int repeatMode)
Sets the repeat-mode for this playlist.

Parameters:
repeatMode - The method this PlayList should be repeated.

setPickMode

public void setPickMode(int pickMode)
Sets the pick-mode for this playlist.

Parameters:
pickMode - The method to be used for picking the songs.

next

public java.io.File next()
Returns the next sound file on this Playlist or null if there is no such sound.

Returns:
The next sound file on this Playlist or null if there is no such sound.

hasNext

public boolean hasNext()
Returns false if this Playlist is exhausted, true otherwise.

Returns:
false if this Playlist is exhausted, true otherwise.