|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
net.sf.freecol.client.gui.sound.SoundPlayer.SoundPlayerThread
class SoundPlayer.SoundPlayerThread
Thread for playing a Playlist.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private int |
delay
|
private int |
pickMode
This is the default pick-mode for a playlist. |
private boolean |
playContinues
Should the SoundPlayer continue to play when it is finished with a sound-clip? |
private Playlist |
playlist
An array containing the currently selected playlist. |
private int |
repeatMode
This is the default repeat-mode for a playlist. |
private boolean |
repeatSound
Should the sound be played again when it is finished? |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
SoundPlayer.SoundPlayerThread(Playlist playlist,
boolean playContinues,
int repeatMode,
int pickMode,
int delay)
The constructor to use. |
|
| Method Summary | |
|---|---|
private javax.sound.sampled.SourceDataLine |
getLine(javax.sound.sampled.AudioFormat audioFormat)
|
void |
playSound(java.io.File file)
|
private void |
rawplay(javax.sound.sampled.AudioFormat targetFormat,
javax.sound.sampled.AudioInputStream din)
|
void |
run()
This thread loads and plays the sound. |
private boolean |
shouldStopThread()
|
private void |
updateVolume(javax.sound.sampled.FloatControl c,
int volume)
|
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Playlist playlist
private boolean playContinues
private int repeatMode
Playlist-class to get the different values.
Playlistprivate int pickMode
Playlist-class to get the different values.
Playlistprivate boolean repeatSound
private int delay
| Constructor Detail |
|---|
public SoundPlayer.SoundPlayerThread(Playlist playlist,
boolean playContinues,
int repeatMode,
int pickMode,
int delay)
playlist - A Playlist containing sound-files.playContinues - Should the player continue playing after it it
finished with a sound-clip?repeatMode - This is the default repeat-mode for a playlist.
Refer to the field summary of the Playlist-class
to get the different values.pickMode - This is the default pick-mode for a playlist. Refer
to the field summary of the Playlist-class to get
the different values.delay - A delay before playing the sound (ms).| Method Detail |
|---|
private boolean shouldStopThread()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void playSound(java.io.File file)
private void updateVolume(javax.sound.sampled.FloatControl c,
int volume)
private void rawplay(javax.sound.sampled.AudioFormat targetFormat,
javax.sound.sampled.AudioInputStream din)
throws java.io.IOException,
javax.sound.sampled.LineUnavailableException
java.io.IOException
javax.sound.sampled.LineUnavailableException
private javax.sound.sampled.SourceDataLine getLine(javax.sound.sampled.AudioFormat audioFormat)
throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||