audio
Class AudioProcessor

java.lang.Object
  extended by audio.AudioProcessor

public class AudioProcessor
extends java.lang.Object

An AudioProcessor maintains a HashMap of links between AudioInterfaces and VideoServers and acks as a sort of switchboard, taking messages from attached devices and sends them to the connected video servers. These messages can be anything from audio data to video output modules.


Constructor Summary
AudioProcessor(Logger logger)
          Creates a new audio processor.
 
Method Summary
 boolean connected(int index)
          Tells us whether or not we are connected to the specified video server.
 void connectInputToOutput(AudioInput audioInterface, int videoServerIndex)
          Links an audio interface to a video server as represented by the thick black lines in the audio processor GUI.
 int createVideoServer()
          Creates a new VideoServer object and stores it
 void disconnectInputFromOutputs(AudioInput audioInterface)
          Removes all connections for the specified audio interface.
 void disconnectOutputFromInputs(VideoServer videoServer)
          Removes a video server from the HashMap.
 java.util.Vector<VideoServer> getConnectedVideoServers(AudioInput audioInterface)
           
 AudioInput getInputDevice(int interfaceToGet)
           
 java.util.Vector<AudioInput> getInputDevices()
           
 VideoServer getVideoServer(int index)
           
 int numConnections(AudioInput audioInterface)
          Returns how many video servers a given audio interface is connected to.
 void sendMessage(java.lang.Object[] arguments, AudioInput sendingInterface)
          Sends an OSC message to the video server.
 void startInterface(int index)
          Starts an interface sending/recieving audio data
 void stopInterface(int index)
          Stops an interface from sending/recieving audio data
 void updateInputDevices()
          Reinitialises the list of available input devices.
 boolean validInterface(int interfaceIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioProcessor

public AudioProcessor(Logger logger)
Creates a new audio processor.

Parameters:
logger - Writes system messages out to a text file
Method Detail

createVideoServer

public int createVideoServer()
Creates a new VideoServer object and stores it

Returns:
The index of the newly created object

getVideoServer

public VideoServer getVideoServer(int index)
Parameters:
index - The index of the VideoServer.
Returns:
A reference to the requested video server.

connected

public boolean connected(int index)
Tells us whether or not we are connected to the specified video server.


updateInputDevices

public void updateInputDevices()
Reinitialises the list of available input devices. To be called if something is unplugged, for example.


getInputDevices

public java.util.Vector<AudioInput> getInputDevices()
Returns:
A Vector of the input devices currently available on the system

getInputDevice

public AudioInput getInputDevice(int interfaceToGet)
Parameters:
interfaceToGet - The index of the requested AudioInterface.
Returns:
A refrerence to the AudioInterface object that represents the audio interface at the given index.

validInterface

public boolean validInterface(int interfaceIndex)
Parameters:
interfaceIndex -
Returns:
Whether there is an interface that corresponds to the requested index

startInterface

public void startInterface(int index)
Starts an interface sending/recieving audio data

Parameters:
index - The index of the AudioInterface

stopInterface

public void stopInterface(int index)
Stops an interface from sending/recieving audio data

Parameters:
index - The index of the AudioInterface.

sendMessage

public void sendMessage(java.lang.Object[] arguments,
                        AudioInput sendingInterface)
Sends an OSC message to the video server. This is done here rather than in the audio driver or the individual input reciever classes so that multiple outputs can be used with each one being assigned one or more audio inputs.

Parameters:
arguments - An Object[] array suitable for turning into an OSC packet
sendingInterface - The interface sending the message (used to ensure that it's sent to the right VideoProcessor).

connectInputToOutput

public void connectInputToOutput(AudioInput audioInterface,
                                 int videoServerIndex)
Links an audio interface to a video server as represented by the thick black lines in the audio processor GUI.

Parameters:
audioInterface - The AudioInterface we wish to connect.
videoServerIndex - The index of the VideoServer we wish to connect it to.

disconnectInputFromOutputs

public void disconnectInputFromOutputs(AudioInput audioInterface)
Removes all connections for the specified audio interface.

Parameters:
audioInterface - The audio interface to disconnect.

getConnectedVideoServers

public java.util.Vector<VideoServer> getConnectedVideoServers(AudioInput audioInterface)
Parameters:
audioInterface - The AudioInterface we wish to know about.
Returns:
A Vector of all the video servers the specified AudioInterface is currently connected to.

numConnections

public int numConnections(AudioInput audioInterface)
Returns how many video servers a given audio interface is connected to.

Parameters:
audioInterface - The AudioInterface we wish to know about.
Returns:
The number of connected servers

disconnectOutputFromInputs

public void disconnectOutputFromInputs(VideoServer videoServer)
Removes a video server from the HashMap.

Parameters:
videoServer - The VideoServer we wish to remove.