uk.org.toot.audio.server
Class AbstractAudioServer

java.lang.Object
  extended by uk.org.toot.audio.server.AbstractAudioServer
All Implemented Interfaces:
uk.org.toot.audio.server.AudioServer
Direct Known Subclasses:
TimedAudioServer

public abstract class AbstractAudioServer
extends java.lang.Object
implements uk.org.toot.audio.server.AudioServer

This class provides generic AudioServer functionality suitable for all AudioServer implementationst. It provides: Buffer management (synchronous resizing) Client Management (enable/diable/work) Start/Stop management (for delayed start)


Field Summary
protected  int bufferFrames
           
protected  long endTimeNanos
           
protected  long startTimeNanos
           
 
Fields inherited from interface uk.org.toot.audio.server.AudioServer
THREAD_NAME
 
Constructor Summary
AbstractAudioServer()
           
 
Method Summary
protected  uk.org.toot.audio.core.AudioBuffer _createAudioBuffer(java.lang.String name)
           
protected  boolean canStart()
           
protected  void checkStart()
           
 uk.org.toot.audio.core.AudioBuffer createAudioBuffer(java.lang.String name)
           
protected  int getBufferFrames()
           
 float getLoad()
           
 void removeAudioBuffer(uk.org.toot.audio.core.AudioBuffer buffer)
           
protected  void resizeBuffers(int bufferFrames)
           
 void setClient(uk.org.toot.audio.server.AudioClient client)
           
 void start()
           
protected abstract  void startImpl()
           
 void stop()
           
protected abstract  void stopImpl()
           
protected  void work()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.org.toot.audio.server.AudioServer
closeAudioInput, closeAudioOutput, getAvailableInputNames, getAvailableOutputNames, getInputLatencyFrames, getOutputLatencyFrames, getSampleRate, getTotalLatencyFrames, isRunning, openAudioInput, openAudioOutput
 

Field Detail

bufferFrames

protected int bufferFrames

startTimeNanos

protected long startTimeNanos

endTimeNanos

protected long endTimeNanos
Constructor Detail

AbstractAudioServer

public AbstractAudioServer()
Method Detail

_createAudioBuffer

protected uk.org.toot.audio.core.AudioBuffer _createAudioBuffer(java.lang.String name)

createAudioBuffer

public uk.org.toot.audio.core.AudioBuffer createAudioBuffer(java.lang.String name)
Specified by:
createAudioBuffer in interface uk.org.toot.audio.server.AudioServer

removeAudioBuffer

public void removeAudioBuffer(uk.org.toot.audio.core.AudioBuffer buffer)

resizeBuffers

protected void resizeBuffers(int bufferFrames)

getBufferFrames

protected int getBufferFrames()

getLoad

public float getLoad()
Specified by:
getLoad in interface uk.org.toot.audio.server.AudioServer

setClient

public void setClient(uk.org.toot.audio.server.AudioClient client)
Specified by:
setClient in interface uk.org.toot.audio.server.AudioServer

work

protected void work()

start

public void start()
Specified by:
start in interface uk.org.toot.audio.server.AudioServer

stop

public void stop()
Specified by:
stop in interface uk.org.toot.audio.server.AudioServer

checkStart

protected void checkStart()

canStart

protected boolean canStart()

startImpl

protected abstract void startImpl()

stopImpl

protected abstract void stopImpl()