de.gulden.framework.jjack
Class JJackAudioEvent

java.lang.Object
  extended by java.util.EventObject
      extended by de.gulden.framework.jjack.JJackAudioEvent
All Implemented Interfaces:
java.io.Serializable

public class JJackAudioEvent
extends java.util.EventObject

Event class to propagate audio data from one audio processor to another.

Version:
0.3
Author:
Jens Gulden
See Also:
Serialized Form

Nested Class Summary
protected  class JJackAudioEvent.ChannelImpl
          Inner class implementing interface JJackAudioChannel.
protected  class JJackAudioEvent.PortImpl
          Inner class implementing interface JJackAudioPort.
 
Field Summary
protected  java.nio.FloatBuffer[] inputBuffer
          Input buffers of this event.
protected  int monoInputPort
          Number of input port to use for mono processors.
protected  int monoOutputPort
          Number of output port to use for mono processors.
protected  java.nio.FloatBuffer[] outputBuffer
          Output buffers of this event.
(package private)  java.util.Stack stack
          Backup stack for output buffers during processing.
protected  long timestamp
          UNIX timestamp of event occurrence
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
JJackAudioEvent(long timestamp, java.lang.Object client, java.nio.FloatBuffer[] inputBuffer, java.nio.FloatBuffer[] outputBuffer)
          Constructor.
 
Method Summary
 int countChannels()
          Returns the number of channels that have both an input and an output channel.
 int countInputPorts()
          Returns the number of channels with an input port.
 int countOutputPorts()
          Returns the number of channels with an output port.
 java.util.Collection getChannels()
          Returns all channels.
 java.nio.FloatBuffer getInput()
          Returns the mono input buffer.
 java.nio.FloatBuffer getInput(int chan)
          Returns the input buffer of the specified channel.
 java.nio.FloatBuffer[] getInputs()
          Returns all input buffers.
 int getMonoInputPort()
          Returns the index number of the input port used for mono access.
 int getMonoOutputPort()
          Returns the index number of the output port used for mono access.
 java.nio.FloatBuffer getOutput()
          Returns the mono output buffer.
 java.nio.FloatBuffer getOutput(int chan)
          Returns the output buffer of the specified channel.
 java.nio.FloatBuffer[] getOutputs()
          Returns all output buffers.
 long getTimestamp()
          Returns the UNIX timestamp marking the time of event occurrence.
 void setInput(java.nio.FloatBuffer buf)
          Sets the mono input buffer.
 void setInput(int chan, java.nio.FloatBuffer buf)
          Sets the input buffer of the specified channel.
 void setMonoInputPort(int port)
          Sets the index number of the input port used for mono access.
 void setMonoOutputPort(int port)
          Sets the index number of the output port used for mono access.
 void setOutput(java.nio.FloatBuffer buf)
          Sets the mono output buffer.
 void setOutput(int chan, java.nio.FloatBuffer buf)
          Sets the output buffer of the specified channel.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

timestamp

protected long timestamp
UNIX timestamp of event occurrence


inputBuffer

protected java.nio.FloatBuffer[] inputBuffer
Input buffers of this event.


outputBuffer

protected java.nio.FloatBuffer[] outputBuffer
Output buffers of this event.


monoInputPort

protected int monoInputPort
Number of input port to use for mono processors.


monoOutputPort

protected int monoOutputPort
Number of output port to use for mono processors.


stack

java.util.Stack stack
Backup stack for output buffers during processing. Package-private, accessed by JJackMonitor only.

Constructor Detail

JJackAudioEvent

public JJackAudioEvent(long timestamp,
                       java.lang.Object client,
                       java.nio.FloatBuffer[] inputBuffer,
                       java.nio.FloatBuffer[] outputBuffer)
Constructor. Creates a new JJackAudioEvent instance with the given parameters.

Parameters:
timestamp - UNIX timestamp of event occurrence
client - source client issuing the event
inputBuffer - array of input buffers to deliver with this event
outputBuffer - array of output buffers to deliver with this event
Method Detail

getTimestamp

public long getTimestamp()
Returns the UNIX timestamp marking the time of event occurrence.

Returns:
the UNIX timestamp value

getInput

public java.nio.FloatBuffer getInput()
Returns the mono input buffer.

Returns:
input buffer of the mono input port.
See Also:
getMonoInputPort()

setInput

public void setInput(java.nio.FloatBuffer buf)
Sets the mono input buffer.

Parameters:
buf - input buffer
See Also:
setMonoInputPort(int)

getOutput

public java.nio.FloatBuffer getOutput()
Returns the mono output buffer.

Returns:
output buffer of the mono output port.
See Also:
getMonoOutputPort()

setOutput

public void setOutput(java.nio.FloatBuffer buf)
Sets the mono output buffer.

Parameters:
buf - output buffer
See Also:
setMonoOutputPort(int)

getInput

public java.nio.FloatBuffer getInput(int chan)
Returns the input buffer of the specified channel.

Parameters:
chan - channel number
Returns:
input buffer

setInput

public void setInput(int chan,
                     java.nio.FloatBuffer buf)
Sets the input buffer of the specified channel.

Parameters:
chan - channel number
buf - input buffer

getOutput

public java.nio.FloatBuffer getOutput(int chan)
Returns the output buffer of the specified channel.

Parameters:
chan - channel number
Returns:
output buffer

setOutput

public void setOutput(int chan,
                      java.nio.FloatBuffer buf)
Sets the output buffer of the specified channel.

Parameters:
chan - channel number
buf - output buffer

countInputPorts

public int countInputPorts()
Returns the number of channels with an input port.

Returns:
number of channels with an input port

countOutputPorts

public int countOutputPorts()
Returns the number of channels with an output port.

Returns:
number of channels with an output port

countChannels

public int countChannels()
Returns the number of channels that have both an input and an output channel. Usually, the number of input and output channels are equal, in that case countInputPorts() == countOutputPorts() == countChannels(). If the number of input and output ports differ, the minimum of both determines the number of channels.

Returns:
number of channels

getInputs

public java.nio.FloatBuffer[] getInputs()
Returns all input buffers.

Returns:
array of all input buffers

getOutputs

public java.nio.FloatBuffer[] getOutputs()
Returns all output buffers.

Returns:
array of all output buffers

getMonoInputPort

public int getMonoInputPort()
Returns the index number of the input port used for mono access.

Returns:
input port index number

getMonoOutputPort

public int getMonoOutputPort()
Returns the index number of the output port used for mono access.

Returns:
output port index number

setMonoInputPort

public void setMonoInputPort(int port)
Sets the index number of the input port used for mono access.


setMonoOutputPort

public void setMonoOutputPort(int port)
Sets the index number of the output port used for mono access.


getChannels

public java.util.Collection getChannels()
Returns all channels. The number of elements in the Collection returned is equals to countChannels().

Returns:
Collection of JJackAudioChannel
See Also:
countChannels()