ddf.minim
Interface Polyphonic

All Known Subinterfaces:
AudioSynthesizer
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

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


noSound

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


isSounding

public 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

public 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

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

Parameters:
signal - the AudioSignal to add

getSignal

public 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

public boolean hasSignal(AudioSignal signal)

signalCount

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

Returns:
the number of signals in the chain

enableSignal

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

Parameters:
i - the index of the signal to enable

enableSignal

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

Parameters:
signal - the AudioSignal to enable

disableSignal

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

Parameters:
i - the index of the signal to disable

disableSignal

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

Parameters:
signal - the AudioSignal to disable

removeSignal

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

Parameters:
signal - the AudioSignal to remove

removeSignal

public 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

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