uk.org.toot.demo
Class ExportAudioProcessAdapter

java.lang.Object
  extended by uk.org.toot.audio.core.AudioProcessAdapter
      extended by uk.org.toot.demo.ExportAudioProcessAdapter
All Implemented Interfaces:
java.lang.Runnable, uk.org.toot.audio.core.AudioProcess
Direct Known Subclasses:
TransportExportAudioProcessAdapter

public abstract class ExportAudioProcessAdapter
extends uk.org.toot.audio.core.AudioProcessAdapter
implements java.lang.Runnable

State transitions in an export cycle: start(); reading = true; writing = true; stop(); reading = false; writing = false; export is active when reading || writing Writing lags reading because it represents the output end of the circular buffer writing to file.


Field Summary
protected  org.tritonus.share.TCircularBuffer circularBuffer
           
protected  java.io.File file
           
protected  javax.sound.sampled.AudioFormat format
           
protected  java.lang.String name
           
protected  boolean reading
           
protected  boolean writing
           
 
Fields inherited from interface uk.org.toot.audio.core.AudioProcess
AUDIO_DISCONNECT, AUDIO_OK
 
Constructor Summary
ExportAudioProcessAdapter(uk.org.toot.audio.core.AudioProcess process, javax.sound.sampled.AudioFormat format, java.lang.String name)
           
 
Method Summary
 int processAudio(uk.org.toot.audio.core.AudioBuffer buf)
           
 void run()
           
 void setFile(java.io.File file)
           
 void start()
           
 void stop()
           
 
Methods inherited from class uk.org.toot.audio.core.AudioProcessAdapter
close, open
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

circularBuffer

protected org.tritonus.share.TCircularBuffer circularBuffer

format

protected javax.sound.sampled.AudioFormat format

reading

protected boolean reading

writing

protected boolean writing

file

protected java.io.File file
Constructor Detail

ExportAudioProcessAdapter

public ExportAudioProcessAdapter(uk.org.toot.audio.core.AudioProcess process,
                                 javax.sound.sampled.AudioFormat format,
                                 java.lang.String name)
Method Detail

processAudio

public int processAudio(uk.org.toot.audio.core.AudioBuffer buf)
Specified by:
processAudio in interface uk.org.toot.audio.core.AudioProcess
Overrides:
processAudio in class uk.org.toot.audio.core.AudioProcessAdapter

setFile

public void setFile(java.io.File file)

start

public void start()

stop

public void stop()

run

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