uk.org.toot.audio.server
Class AbstractAudioServerDecorator

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

public abstract class AbstractAudioServerDecorator
extends java.lang.Object
implements AudioServer

This class is provided so that classes that want to decorate some AudioServer methods don't have to delegate all methods to the decorated AudioServer.

Author:
st

Field Summary
 
Fields inherited from interface uk.org.toot.audio.server.AudioServer
THREAD_NAME
 
Constructor Summary
AbstractAudioServerDecorator(AudioServer server)
           
 
Method Summary
 void closeAudioInput(IOAudioProcess input)
           
 void closeAudioOutput(IOAudioProcess output)
           
 AudioBuffer createAudioBuffer(java.lang.String name)
           
 java.util.List<java.lang.String> getAvailableInputNames()
           
 java.util.List<java.lang.String> getAvailableOutputNames()
           
 int getInputLatencyFrames()
           
 float getLoad()
           
 int getOutputLatencyFrames()
           
 float getSampleRate()
           
 int getTotalLatencyFrames()
           
 boolean isRunning()
          Returns whether running.
 IOAudioProcess openAudioInput(java.lang.String name, java.lang.String label)
          Returns an AudioProcess backed by a hardware audio input line represented by 'name' and labelled 'label'.
 IOAudioProcess openAudioOutput(java.lang.String name, java.lang.String label)
          Returns an AudioProcess backed by a hardware audio output line represented by 'name' and labelled 'label'.
 void setClient(AudioClient client)
          Sets the single AudioClient.
 void start()
          Requests that the server starts if possible, otherwise actual start will be deferred until it is possible.
 void stop()
          Stops the server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAudioServerDecorator

public AbstractAudioServerDecorator(AudioServer server)
Method Detail

openAudioInput

public IOAudioProcess openAudioInput(java.lang.String name,
                                     java.lang.String label)
                              throws java.lang.Exception
Description copied from interface: AudioServer
Returns an AudioProcess backed by a hardware audio input line represented by 'name' and labelled 'label'.

Specified by:
openAudioInput in interface AudioServer
Throws:
java.lang.Exception

openAudioOutput

public IOAudioProcess openAudioOutput(java.lang.String name,
                                      java.lang.String label)
                               throws java.lang.Exception
Description copied from interface: AudioServer
Returns an AudioProcess backed by a hardware audio output line represented by 'name' and labelled 'label'. start may be deferred until called at least once.

Specified by:
openAudioOutput in interface AudioServer
Throws:
java.lang.Exception

closeAudioInput

public void closeAudioInput(IOAudioProcess input)
Specified by:
closeAudioInput in interface AudioServer

closeAudioOutput

public void closeAudioOutput(IOAudioProcess output)
Specified by:
closeAudioOutput in interface AudioServer

getAvailableInputNames

public java.util.List<java.lang.String> getAvailableInputNames()
Specified by:
getAvailableInputNames in interface AudioServer

getAvailableOutputNames

public java.util.List<java.lang.String> getAvailableOutputNames()
Specified by:
getAvailableOutputNames in interface AudioServer

createAudioBuffer

public AudioBuffer createAudioBuffer(java.lang.String name)
Specified by:
createAudioBuffer in interface AudioServer

getInputLatencyFrames

public int getInputLatencyFrames()
Specified by:
getInputLatencyFrames in interface AudioServer
Returns:
the number of frames input latency due to software and hardware.

getOutputLatencyFrames

public int getOutputLatencyFrames()
Specified by:
getOutputLatencyFrames in interface AudioServer
Returns:
the number of frames output latency due to software and hardware.

getTotalLatencyFrames

public int getTotalLatencyFrames()
Specified by:
getTotalLatencyFrames in interface AudioServer
Returns:
the number of frames latency for inputs and outputs due to both hardware and software.

isRunning

public boolean isRunning()
Description copied from interface: AudioServer
Returns whether running. i.e. started but not stopped. Contract is that AudioClient.work(int nFrames) must be called when true.

Specified by:
isRunning in interface AudioServer

setClient

public void setClient(AudioClient client)
Description copied from interface: AudioServer
Sets the single AudioClient. Use CompoundAudioClient for multiple client support. Typically start may be deferred until called at least once.

Specified by:
setClient in interface AudioServer

start

public void start()
Description copied from interface: AudioServer
Requests that the server starts if possible, otherwise actual start will be deferred until it is possible. Typically start may become possible after a setClient call and potentially one or more createAudioOutput or createAudioInput calls.

Specified by:
start in interface AudioServer

stop

public void stop()
Description copied from interface: AudioServer
Stops the server.

Specified by:
stop in interface AudioServer

getSampleRate

public float getSampleRate()
Specified by:
getSampleRate in interface AudioServer

getLoad

public float getLoad()
Specified by:
getLoad in interface AudioServer
Returns:
the normalised server load 0..1f


Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.