|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
at.tuwien.ifs.somtoolbox.apps.viewer.controls.multichannelPlayback.PlaybackThread
public class PlaybackThread
Represents two nodes / one output line
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
(package private) boolean[] |
aEmpty
Flag if channel is empty: in this case, there will be silence on the respective channel |
(package private) File[][] |
aFiles
Files to play |
protected AudioInputStream[] |
ain
|
(package private) Point[] |
aPos
|
(package private) boolean[] |
aWaitForDecoder
Flag: if true , then the respective channel is waiting for a DecoderThread to finish. |
(package private) boolean |
bOtherChannelAlreadyFinished
(if bRepeat == false): if the first channel's musicfile stops, it is set to true. |
protected boolean |
bQuitLoop
|
(package private) boolean |
bRepeat_Shuffle
Flag: if true, then music is played endlessly, alwas repeating. |
protected byte[][] |
buffer
|
(package private) boolean |
bUpdStats
Flag: if false, no global statistic variable will be updated by this Thread |
protected byte[] |
datalinebuffer
|
protected int |
datalineframesize
|
protected File |
file1
|
protected File |
file2
|
(package private) String |
id
|
protected SourceDataLine |
line
|
protected int |
monoframesize
|
(package private) float |
p_decode
Probability to decode a mp3 file to wav |
protected boolean |
ready
|
private boolean |
threadSuspended
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
PlaybackThread(String id,
TPlaybackThreadDataRecord record,
SourceDataLine line)
Convenience constructur that takes a TPlaybackThreadDataRecord and pulls all data from it to create
a new thread |
|
PlaybackThread(String id,
TPlaybackThreadDataRecord record,
SourceDataLine line,
boolean bRepeat,
float p_decode)
|
|
PlaybackThread(String id,
TPlaybackThreadDataRecord record,
SourceDataLine line,
boolean bRepeat,
float p_decode,
boolean bUpdStats)
|
Method Summary | |
---|---|
void |
decodingFailed(int channel,
boolean stats)
|
void |
decodingFinished(File file,
int channel,
boolean stats,
DecoderThread dt)
|
AudioInputStream |
getNextSong(int channel,
boolean stats)
|
protected void |
log_fine(String msg)
|
protected void |
log_info(String msg)
|
protected void |
log_warning(String msg)
|
void |
muteChannel(int channel)
|
void |
pause_playback()
|
AudioInputStream |
prepareAin(File file,
int channel,
boolean stats)
|
void |
resume_playback()
|
void |
run()
|
void |
stop_playback()
|
void |
unmuteChannel(int channel)
|
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 |
---|
String id
Point[] aPos
File[][] aFiles
boolean[] aEmpty
boolean[] aWaitForDecoder
true
, then the respective channel is waiting for a DecoderThread
to finish.
boolean bRepeat_Shuffle
If false, then on each channel there will be played each song in the list, from the first to the last, then exit.
boolean bUpdStats
float p_decode
boolean bOtherChannelAlreadyFinished
If the second channel's musicfile stops, this thread is stopped.
private boolean threadSuspended
protected File file1
protected File file2
protected SourceDataLine line
protected AudioInputStream[] ain
protected boolean ready
protected boolean bQuitLoop
protected int datalineframesize
protected int monoframesize
protected byte[][] buffer
protected byte[] datalinebuffer
Constructor Detail |
---|
public PlaybackThread(String id, TPlaybackThreadDataRecord record, SourceDataLine line, boolean bRepeat, float p_decode, boolean bUpdStats)
public PlaybackThread(String id, TPlaybackThreadDataRecord record, SourceDataLine line, boolean bRepeat, float p_decode)
public PlaybackThread(String id, TPlaybackThreadDataRecord record, SourceDataLine line)
TPlaybackThreadDataRecord
and pulls all data from it to create
a new thread
Note the constructor call that looks quite crazy with all its necessary casts.
Method Detail |
---|
public void muteChannel(int channel)
public void unmuteChannel(int channel)
public AudioInputStream getNextSong(int channel, boolean stats) throws IOException, UnsupportedAudioFileException
IOException
UnsupportedAudioFileException
public AudioInputStream prepareAin(File file, int channel, boolean stats) throws IOException, UnsupportedAudioFileException
IOException
UnsupportedAudioFileException
public void decodingFinished(File file, int channel, boolean stats, DecoderThread dt)
public void decodingFailed(int channel, boolean stats)
public void run()
run
in interface Runnable
run
in class Thread
public void stop_playback()
public void pause_playback()
public void resume_playback()
protected void log_fine(String msg)
protected void log_info(String msg)
protected void log_warning(String msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |