com.frinika.toot.javasoundmultiplexed
Class MultiplexedJavaSoundAudioServer

java.lang.Object
  extended by uk.org.toot.audio.server.AbstractAudioServer
      extended by uk.org.toot.audio.server.TimedAudioServer
          extended by com.frinika.toot.PriorityAudioServer
              extended by com.frinika.toot.javasoundmultiplexed.MultiplexedJavaSoundAudioServer
All Implemented Interfaces:
java.lang.Runnable, uk.org.toot.audio.server.AudioServer, ExtendedAudioServer

public class MultiplexedJavaSoundAudioServer
extends PriorityAudioServer

MultiplexedJavaSoundAudioServer Provides a Server based on a single javasound DataLine for inout and output. The widest (most channels) line is used. The server provides IOAudioProcess that can be mono or stereo based on 1 or 2 channels of the target data line.


Field Summary
 
Fields inherited from class uk.org.toot.audio.server.TimedAudioServer
hasStopped, isRunning, maximumLatencyMilliseconds, stableCount, stableThreshold, started, syncLine
 
Fields inherited from class uk.org.toot.audio.server.AbstractAudioServer
bufferFrames, endTimeNanos, startTimeNanos
 
Fields inherited from interface uk.org.toot.audio.server.AudioServer
THREAD_NAME
 
Constructor Summary
MultiplexedJavaSoundAudioServer()
           
 
Method Summary
 void closeAudioInput(uk.org.toot.audio.server.IOAudioProcess input)
           
 void closeAudioOutput(uk.org.toot.audio.server.IOAudioProcess output)
           
protected  void controlGained()
          Called when the control loop gains control.
protected  void flushInputs()
           
 java.util.List<java.lang.String> getAvailableInputNames()
           
 java.util.List<java.lang.String> getAvailableOutputNames()
           
 java.lang.String getConfigKey()
           
 java.util.List<java.lang.String> getInDeviceList()
           
 int getInputLatencyFrames()
           
 java.util.List<AudioLine> getInputs()
           
 java.util.List<java.lang.String> getOutDeviceList()
           
 int getOutputLatencyFrames()
           
 java.util.List<AudioLine> getOutputs()
           
 float getSampleRate()
           
 int getSampleSizeInBits()
           
 uk.org.toot.audio.server.IOAudioProcess openAudioInput(java.lang.String name, java.lang.String label)
           
 uk.org.toot.audio.server.IOAudioProcess openAudioOutput(java.lang.String name, java.lang.String label)
           
protected  void resizeBuffers()
           
 void setInDevice(java.lang.String name)
           
 void setLatencyMilliseconds(float ms)
          Set the software output latency request in milliseconds.
 void setOutDevice(java.lang.String name)
           
 void start()
           
 void stop()
           
 void work()
           
 
Methods inherited from class com.frinika.toot.PriorityAudioServer
assertPriority, getPriority, requestPriority
 
Methods inherited from class uk.org.toot.audio.server.TimedAudioServer
calculateBufferFrames, canStart, getActualLatencyMilliseconds, getBufferMilliseconds, getBufferUnderRuns, getLatencyMilliseconds, getLowestLatencyMilliseconds, getMaximumLatencyMilliseconds, getMinimumLatencyMilliseconds, getTotalLatencyFrames, isRunning, reset, resetMetrics, run, setBufferMilliseconds, startImpl, stopImpl, sync
 
Methods inherited from class uk.org.toot.audio.server.AbstractAudioServer
_createAudioBuffer, checkStart, createAudioBuffer, getBufferFrames, getLoad, removeAudioBuffer, resizeBuffers, setClient
 
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
createAudioBuffer, getLoad, setClient
 

Constructor Detail

MultiplexedJavaSoundAudioServer

public MultiplexedJavaSoundAudioServer()
Method Detail

getSampleRate

public float getSampleRate()

getSampleSizeInBits

public int getSampleSizeInBits()

getOutputs

public java.util.List<AudioLine> getOutputs()

getInputs

public java.util.List<AudioLine> getInputs()

resizeBuffers

protected void resizeBuffers()

getInDeviceList

public java.util.List<java.lang.String> getInDeviceList()

getOutDeviceList

public java.util.List<java.lang.String> getOutDeviceList()

setOutDevice

public void setOutDevice(java.lang.String name)

setInDevice

public void setInDevice(java.lang.String name)

getOutputLatencyFrames

public int getOutputLatencyFrames()

getInputLatencyFrames

public int getInputLatencyFrames()

getAvailableOutputNames

public java.util.List<java.lang.String> getAvailableOutputNames()

getAvailableInputNames

public java.util.List<java.lang.String> getAvailableInputNames()

start

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

stop

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

openAudioOutput

public uk.org.toot.audio.server.IOAudioProcess openAudioOutput(java.lang.String name,
                                                               java.lang.String label)
                                                        throws java.lang.Exception
Throws:
java.lang.Exception

closeAudioOutput

public void closeAudioOutput(uk.org.toot.audio.server.IOAudioProcess output)

openAudioInput

public uk.org.toot.audio.server.IOAudioProcess openAudioInput(java.lang.String name,
                                                              java.lang.String label)
                                                       throws java.lang.Exception
Throws:
java.lang.Exception

closeAudioInput

public void closeAudioInput(uk.org.toot.audio.server.IOAudioProcess input)

setLatencyMilliseconds

public void setLatencyMilliseconds(float ms)
Description copied from class: TimedAudioServer
Set the software output latency request in milliseconds. This is the demand to the control loop.

Specified by:
setLatencyMilliseconds in interface ExtendedAudioServer
Overrides:
setLatencyMilliseconds in class TimedAudioServer

flushInputs

protected void flushInputs()

controlGained

protected void controlGained()
Description copied from class: TimedAudioServer
Called when the control loop gains control.

Overrides:
controlGained in class TimedAudioServer

getConfigKey

public java.lang.String getConfigKey()

work

public void work()
Overrides:
work in class PriorityAudioServer