de.gulden.framework.jjack

Class JJackMonitor

public abstract class JJackMonitor extends JPanel implements JJackAudioProcessorMonitorable, JJackAudioConsumer, JJackAudioProcessListener, JJackConstants

Abstract base class for JJack clients that listen to input but do not generate output. The feature of generating output is added by the subclass JJackClient. Classes derived from this one can also be used as visible JavaBeans.

Version: 0.3

Author: Jens Gulden

See Also: JJackClient JJackBeanInfoAbstract

Field Summary
protected booleanactive
Flag marking active mode.
protected JJackAudioProducerchained
Chained audio processor.
protected JComponentgui
The GUI component associated with this audio processor.
protected ArrayListlisteners
JJackAudioProcessListeners connected to this processor.
protected ArrayListmonitors
Monitor-processors connected to this processor.
protected Stringname
The audio processor's name.
Constructor Summary
JJackMonitor()
Constructor.
JJackMonitor(String name)
Constructor.
JJackMonitor(boolean active)
Constructor.
JJackMonitor(String name, boolean active)
Constructor.
Method Summary
voidaddAudioProcessListener(JJackAudioProcessListener l)
Adds a JJackAudioProcessListener to this audio processor.
voidaddMonitor(JJackAudioConsumer p)
Adds a monitor processor after this processor.
voidafterProcess(JJackAudioEvent e)
Event handler method called after the supervised audio processor has performed its process()-method.
voidbeforeProcess(JJackAudioEvent e)
Event handler method called before the supervised audio processor performs its process()-method.
protected JComponentcreateUI()
Creates the user interface.
static voidexc(Exception e)
Outputs an Exception's type and message.
CollectiongetAudioProcessListeners()
Returns all JJackAudioProcessListeners.
JJackAudioProducergetChained()
Returns the next audio processor in chain.
StringgetInfo()
Returns a short info text about this audio processor.
CollectiongetMonitors()
Returns all monitor processors currently connected after this processor.
StringgetName()
Returns the audio processor's name.
intgetSampleRate()
Returns the sample rate with which the JACK daemon is running.
protected voidinitUI()
Initializes the user interface.
abstract voidprocess(JJackAudioEvent e)
Process multiple samples from input buffer to output buffer.
voidremoveAudioProcessListener(JJackAudioProcessListener l)
Removes a JJackAudioProcessListener from this audio processor.
voidremoveChained(JJackAudioProducer p)
Removes p as the next audio processor in chain, if it is the currently chained processor.
voidremoveMonitor(JJackAudioConsumer p)
Removes a monitor processor from this processor.
voidsetChained(JJackAudioProducer p)
Sets the next audio processor in chain.
voidsetName(String name)
Sets the audio processor's name.
voidupdateUI()
Synchronize user interface with parameter values.

Field Detail

active

protected boolean active
Flag marking active mode. In active mode, the output of this processor is being swapped to be the input of any chained and monitoring processor. In inactive mode, inputs to this processor are simply passed on to the next processors.

chained

protected JJackAudioProducer chained
Chained audio processor. null if this is the last processor in the chain.

gui

protected JComponent gui
The GUI component associated with this audio processor.

listeners

protected ArrayList listeners
JJackAudioProcessListeners connected to this processor.

monitors

protected ArrayList monitors
Monitor-processors connected to this processor.

name

protected String name
The audio processor's name.

Constructor Detail

JJackMonitor

public JJackMonitor()
Constructor. Creates a new instance named as the unqualified classname and initially set to inactive processing mode.

JJackMonitor

public JJackMonitor(String name)
Constructor. Creates a new instance, initially set to inactive processing mode.

Parameters: name the processor's name

JJackMonitor

public JJackMonitor(boolean active)
Constructor. Creates a new instance named as the unqualified classname.

Parameters: active sets whether to run in active or inactive mode.

See Also: active

JJackMonitor

public JJackMonitor(String name, boolean active)
Constructor.

Parameters: name the processor's name active sets whether to run in active or inactive mode.

See Also: active

Method Detail

addAudioProcessListener

public void addAudioProcessListener(JJackAudioProcessListener l)
Adds a JJackAudioProcessListener to this audio processor.

Parameters: l the JJackAudioProcessListener to add

addMonitor

public void addMonitor(JJackAudioConsumer p)
Adds a monitor processor after this processor. The monitor processor will get the output of this processor as its own input.

afterProcess

public void afterProcess(JJackAudioEvent e)
Event handler method called after the supervised audio processor has performed its process()-method.

Parameters: e audio event that has been processed by the supervised audio processor

beforeProcess

public void beforeProcess(JJackAudioEvent e)
Event handler method called before the supervised audio processor performs its process()-method.

Parameters: e audio event that is going to be processed by the supervised audio processor

createUI

protected JComponent createUI()
Creates the user interface.

Returns: visible component with the user interface, or null if this is an invisible audio processor

exc

static void exc(Exception e)
Outputs an Exception's type and message. Program execution is not interrupted.

Parameters: e the exception

getAudioProcessListeners

public Collection getAudioProcessListeners()
Returns all JJackAudioProcessListeners.

Returns: Collection of JJackAudioProcessListener

getChained

public JJackAudioProducer getChained()
Returns the next audio processor in chain.

Returns: the next audio processor in chain, null if no processor is chained to this

getInfo

public String getInfo()
Returns a short info text about this audio processor.

Returns: info text, or null if no info is available

getMonitors

public Collection getMonitors()
Returns all monitor processors currently connected after this processor.

Returns: Collection of JJackAudioConsumer

getName

public String getName()
Returns the audio processor's name.

Returns: the name

getSampleRate

public int getSampleRate()
Returns the sample rate with which the JACK daemon is running.

Returns: the sample rate in samples per second

initUI

protected void initUI()
Initializes the user interface.

See Also: createUI

process

public abstract void process(JJackAudioEvent e)
Process multiple samples from input buffer to output buffer. This is regularly called by the JACK daemon.

Parameters: e event object with references to input buffer and output buffer.

removeAudioProcessListener

public void removeAudioProcessListener(JJackAudioProcessListener l)
Removes a JJackAudioProcessListener from this audio processor.

Parameters: l the JJackAudioProcessListener to remove

removeChained

public void removeChained(JJackAudioProducer p)
Removes p as the next audio processor in chain, if it is the currently chained processor.

Parameters: p the current audio processor in chain

removeMonitor

public void removeMonitor(JJackAudioConsumer p)
Removes a monitor processor from this processor.

setChained

public void setChained(JJackAudioProducer p)
Sets the next audio processor in chain. The chained processor will get the output of this processor as its own input.

Parameters: p the next audio processor in chain

setName

public void setName(String name)
Sets the audio processor's name.

Parameters: name the name

updateUI

public void updateUI()
Synchronize user interface with parameter values.