at.tuwien.ifs.somtoolbox.apps.viewer.controls.player
Class AudioPlayThread

java.lang.Object
  extended by java.lang.Thread
      extended by at.tuwien.ifs.somtoolbox.apps.viewer.controls.player.AudioPlayThread
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
FlatAudioPlayThread, MP3PlayThread

public abstract class AudioPlayThread
extends Thread

Author:
Jakob Frank

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  PlayerListener listener
           
protected  AudioVectorMetaData song
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AudioPlayThread(AudioVectorMetaData song, PlayerListener someoneToInform)
           
 
Method Summary
abstract  boolean doPlaying()
          Play the audio file.
 void run()
           
abstract  void stopPlaying()
          Interrupt/Stop the playing.
 
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

listener

private final PlayerListener listener

song

protected final AudioVectorMetaData song
Constructor Detail

AudioPlayThread

public AudioPlayThread(AudioVectorMetaData song,
                       PlayerListener someoneToInform)
Parameters:
song - the Song that will be played.
someoneToInform - someone to inform when the playing has ended.
Method Detail

run

public final void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

doPlaying

public abstract boolean doPlaying()
Play the audio file. This method must block until replay is finished.

Returns:
true iff the file was played to the end, false otherwise.

stopPlaying

public abstract void stopPlaying()
Interrupt/Stop the playing. The method doPlaying() should return false in this case.