at.tuwien.ifs.somtoolbox.apps.viewer.controls.player
Class AudioPlayThread
java.lang.Object
java.lang.Thread
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
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 |
listener
private final PlayerListener listener
song
protected final AudioVectorMetaData song
AudioPlayThread
public AudioPlayThread(AudioVectorMetaData song,
PlayerListener someoneToInform)
- Parameters:
song
- the Song that will be played.someoneToInform
- someone to inform when the playing has ended.
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.