net.sf.freecol.client.gui.sound
Class SoundPlayer.SoundPlayerThread

java.lang.Object
  extended by java.lang.Thread
      extended by net.sf.freecol.client.gui.sound.SoundPlayer.SoundPlayerThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
SoundPlayer

private class SoundPlayer.SoundPlayerThread
extends java.lang.Thread

Thread for playing sound files.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  boolean playDone
           
private  java.util.List<java.io.File> playList
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SoundPlayer.SoundPlayerThread()
           
 
Method Summary
 void add(java.io.File file)
           
private  void awaken()
           
private  void goToSleep()
           
 boolean keepPlaying()
           
private  javax.sound.sampled.SourceDataLine openLine(javax.sound.sampled.AudioFormat audioFormat)
           
private  boolean playSound(java.io.File file)
           
private  void rawplay(javax.sound.sampled.AudioInputStream din, javax.sound.sampled.SourceDataLine lin)
           
 void run()
           
private  void setVolume(javax.sound.sampled.SourceDataLine line, int vol)
           
private  void sleep(int t)
           
 void startPlaying()
           
 void stopPlaying()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

playList

private final java.util.List<java.io.File> playList

playDone

private boolean playDone
Constructor Detail

SoundPlayer.SoundPlayerThread

public SoundPlayer.SoundPlayerThread()
Method Detail

awaken

private void awaken()

goToSleep

private void goToSleep()
                throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

keepPlaying

public boolean keepPlaying()

startPlaying

public void startPlaying()

stopPlaying

public void stopPlaying()

add

public void add(java.io.File file)

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

sleep

private void sleep(int t)

setVolume

private void setVolume(javax.sound.sampled.SourceDataLine line,
                       int vol)

openLine

private javax.sound.sampled.SourceDataLine openLine(javax.sound.sampled.AudioFormat audioFormat)

playSound

private boolean playSound(java.io.File file)

rawplay

private void rawplay(javax.sound.sampled.AudioInputStream din,
                     javax.sound.sampled.SourceDataLine lin)
              throws java.io.IOException
Throws:
java.io.IOException