ddf.minim
Interface Polyphonic

All Known Implementing Classes:
AudioOutput

public interface Polyphonic

Polyphonic describes an object that can have multiple AudioSignals attached to it. It is implemented by AudioOutput.

Author:
Damien Di Fede

Method Summary
 void addSignal(AudioSignal signal)
          Adds an signal to the signals chain.
 void clearSignals()
          Removes all signals from the signal chain.
 void disableSignal(AudioSignal signal)
          Disables signal if it is in the chain.
 void disableSignal(int i)
          disables the ith signal in the signal chain.
 void enableSignal(AudioSignal signal)
          Enables signal if it is in the chain.
 void enableSignal(int i)
          Enables the ith signal in the signal chain.
 AudioSignal getSignal(int i)
          Returns the ith signal in the signal chain.
 boolean hasSignal(AudioSignal signal)
           
 boolean isEnabled(AudioSignal signal)
          Returns true if signal is in the chain and is also enabled.
 boolean isSounding()
          Returns true if at least one signal in the chain is enabled.
 void noSound()
          Disables all signals currently attached to this.
 void removeSignal(AudioSignal signal)
          Removes signal from the signals chain.
 AudioSignal removeSignal(int i)
          Removes and returns the ith signal in the signal chain.
 int signalCount()
          Returns the number of signals in the chain.
 void sound()
          Enables all signals currently attached to this.
 

Method Detail

sound

void sound()
Enables all signals currently attached to this. If you want to enable only a single signal, use enableSignal(int).


noSound

void noSound()
Disables all signals currently attached to this. If you want to disable only a single signal, use disableSignal(int).


isSounding

boolean isSounding()
Returns true if at least one signal in the chain is enabled.

Returns:
true if at least one signal in the signal chain is enabled

isEnabled

boolean isEnabled(AudioSignal signal)
Returns true if signal is in the chain and is also enabled.

Parameters:
signal - the AudioSignal to check the status of
Returns:
true if signal is in the chain and is enabled

addSignal

void addSignal(AudioSignal signal)
Adds an signal to the signals chain.

Parameters:
signal - the AudioSignal to add

getSignal

AudioSignal getSignal(int i)
Returns the ith signal in the signal chain. This method is not required to do bounds checking and may throw an ArrayOutOfBoundsException if i is larger than signalCount().

Parameters:
i - which signal to return
Returns:
the requested signal

hasSignal

boolean hasSignal(AudioSignal signal)

signalCount

int signalCount()
Returns the number of signals in the chain.

Returns:
the number of signals in the chain

enableSignal

void enableSignal(int i)
Enables the ith signal in the signal chain.

Parameters:
i - the index of the signal to enable

enableSignal

void enableSignal(AudioSignal signal)
Enables signal if it is in the chain.

Parameters:
signal - the AudioSignal to enable

disableSignal

void disableSignal(int i)
disables the ith signal in the signal chain.

Parameters:
i - the index of the signal to disable

disableSignal

void disableSignal(AudioSignal signal)
Disables signal if it is in the chain.

Parameters:
signal - the AudioSignal to disable

removeSignal

void removeSignal(AudioSignal signal)
Removes signal from the signals chain.

Parameters:
signal - the AudioSignal to remove

removeSignal

AudioSignal removeSignal(int i)
Removes and returns the ith signal in the signal chain.

Parameters:
i - which signal to remove
Returns:
the removed AudioSignal

clearSignals

void clearSignals()
Removes all signals from the signal chain.