|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.freecol.client.gui.sound.SoundPlayer
public class SoundPlayer
Class for playing sound. See the package description for
net.sf.freecol.client.gui.sound
for information on how to play
sfx/music.
Field Summary | |
---|---|
static int |
STANDARD_DELAY
|
Constructor Summary | |
---|---|
SoundPlayer(AudioMixerOption mixerOption,
PercentageOption volume,
boolean multipleSounds,
boolean defaultPlayContinues)
Use this constructor. |
|
SoundPlayer(AudioMixerOption mixerOption,
PercentageOption volume,
boolean multipleSounds,
boolean defaultPlayContinues,
int defaultRepeatMode,
int defaultPickMode)
Or this. |
Method Summary | |
---|---|
boolean |
isPaused()
Are the sounds paused? |
boolean |
isStopped()
Are the sounds stopped? |
void |
pause()
Pauses all the sounds. |
void |
play(Playlist playlist)
Plays a playlist using the default play-continues, repeat-mode and pick-mode for this SoundPlayer. |
void |
play(Playlist playlist,
boolean playContinues,
int repeatMode,
int pickMode,
int delay)
Plays a playlist. |
void |
play(Playlist playlist,
int delay)
Plays a playlist using the default play-continues, repeat-mode and pick-mode for this SoundPlayer. |
void |
playOnce(Playlist playlist)
Plays a single random sound from the given playlist. |
void |
playOnce(Playlist playlist,
int delay)
Plays a single random sound from the given playlist. |
void |
stop()
Stop playing the sounds. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STANDARD_DELAY
Constructor Detail |
---|
public SoundPlayer(AudioMixerOption mixerOption, PercentageOption volume, boolean multipleSounds, boolean defaultPlayContinues)
mixerOption
- The option for setting the mixer used by this
SoundPlayer
.volume
- The volume to be used when playing audio.multipleSounds
- Should the SoundPlayer play multiple sounds
at the same time, or only one? If it does not allow multiple
sounds, then using play will stop the sound currently
playing and play the new instead.defaultPlayContinues
- Should the player continue playing after it
it finished with a sound-clip? This is the default used with
the play(Playlist playlist).public SoundPlayer(AudioMixerOption mixerOption, PercentageOption volume, boolean multipleSounds, boolean defaultPlayContinues, int defaultRepeatMode, int defaultPickMode)
mixerOption
- The option for setting the mixer used by this
SoundPlayer
.volume
- The volume to be used when playing audio.multipleSounds
- Should the SoundPlayer play multiple sounds
at the same time, or only one? If it does not allow multiple
sounds, then using play will stop the sound currently
playing and play the new instead.defaultRepeatMode
- This is the default repeat-mode for a playlist.
Refer to the field summary of the Playlist
-class to
get the different values.defaultPickMode
- This is the default pick-mode for a playlist.
Refer to the field summary of the Playlist
-class to
get the different values.defaultPlayContinues
- Should the player continue playing after it
it finished with a sound-clip? This is the default used with
the play(Playlist playlist).Method Detail |
---|
public void play(Playlist playlist)
playlist
- The Playlist
to be played.public void play(Playlist playlist, int delay)
playlist
- The Playlist
to be played.delay
- A delay before playing the sound (ms).public void playOnce(Playlist playlist)
playlist
- The Playlist
to be played.public void playOnce(Playlist playlist, int delay)
playlist
- The Playlist
to be played.delay
- A delay before playing the sound (ms).public void play(Playlist playlist, boolean playContinues, int repeatMode, int pickMode, int delay)
playlist
- The Playlist
to be played.playContinues
- true
if the SoundPlayer
should continue playing after playing the first entry on the
playlist.repeatMode
- The method this PlayList
should be
repeated.pickMode
- The method to be used for picking the songs.delay
- A delay before playing the sound (ms).public void stop()
public boolean isStopped()
true
is the sounds are stopped.public void pause()
public boolean isPaused()
true
is the sounds are paused.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |