@Deprecated public class SignalChain extends java.lang.Object implements AudioSignal
SignalChain
is a list of AudioSignals
that gives you the ability to enable (unmute) and disable (mute) signals.
When you add a signal, it is added to the end of the chain and is enabled.
When you remove a signal, signals further down the chain are moved up a slot.
SignalChain
is itself an AudioSignal
, so you
can easily create groups of signals that can be enabled/disabled together by
putting them in an SignalChain
and then adding that chain to a
Polyphonic
object as a single signal. When the signal chain is
asked to generate a signal, it asks each of its signals to generate audio and
then mixes all of the signals together. SignalChain
is fully
synchronized
so that signals cannot be added and removed from
the chain during signal generation.Constructor and Description |
---|
SignalChain()
Deprecated.
Constructs an empty
SignalChain . |
Modifier and Type | Method and Description |
---|---|
void |
add(AudioSignal signal)
Deprecated.
Adds
signal to the end of the chain. |
void |
clear()
Deprecated.
Removes all signals from the effect chain.
|
boolean |
contains(AudioSignal s)
Deprecated.
Returns true if
s is in the chain. |
void |
disable(AudioSignal signal)
Deprecated.
Disables
signal if it is in the chain. |
void |
disable(int i)
Deprecated.
Disables the
i th effect in the chain. |
void |
disableAll()
Deprecated.
Disables all signals in the chain.
|
void |
enable(AudioSignal signal)
Deprecated.
Enables
signal if it is in the chain. |
void |
enable(int i)
Deprecated.
Enables the
i th effect in the chain. |
void |
enableAll()
Deprecated.
Enables all signals in the chain.
|
void |
generate(float[] signal)
Deprecated.
Asks all the enabled signals in the chain to generate a new buffer of
samples, adds the buffers together and puts the result in
signal . |
void |
generate(float[] left,
float[] right)
Deprecated.
Asks all the enabled signals in the chain to generate a left and right
buffer of samples, adds the signals together and puts the result in
left and right . |
AudioSignal |
get(int i)
Deprecated.
Gets the
ith signal in the chain. |
boolean |
hasEnabled()
Deprecated.
Returns true if at least one effect in the chain is enabled.
|
boolean |
isEnabled(AudioSignal signal)
Deprecated.
Returns true if
e is in the chain and is enabled. |
void |
remove(AudioSignal signal)
Deprecated.
Removes
signal from the chain. |
AudioSignal |
remove(int i)
Deprecated.
Removes and returns the
i th signal from the
chain. |
int |
size()
Deprecated.
Returns the number of signals in the chain.
|
public void add(AudioSignal signal)
signal
to the end of the chain.signal
- the AudioEffect
to addpublic void remove(AudioSignal signal)
signal
from the chain.signal
- the AudioSignal
to removepublic AudioSignal remove(int i)
i
th signal from the
chain.i
- the index of the AudioSignal
to removeAudioSignal
that was removedpublic AudioSignal get(int i)
ith
signal in the chain.i
- the index of the AudioSignal
to getith
signal in the chain.public boolean contains(AudioSignal s)
s
is in the chain.s
- the AudioSignal
to check fors
is in the chainpublic void enable(int i)
i
th effect in the chain.i
- the index of the effect to enablepublic void enable(AudioSignal signal)
signal
if it is in the chain.signal
- the AudioSignal
to enablepublic void enableAll()
public boolean hasEnabled()
public boolean isEnabled(AudioSignal signal)
e
is in the chain and is enabled.signal
- the AudioSignal
to return the status ofsignal
is enabled and in the chainpublic void disable(int i)
i
th effect in the chain.i
- the index of the effect to disablepublic void disable(AudioSignal signal)
signal
if it is in the chain.signal
- the AudioSignal
to disablepublic void disableAll()
public int size()
public void clear()
public void generate(float[] signal)
signal
.generate
in interface AudioSignal
signal
- the float array to fillpublic void generate(float[] left, float[] right)
left
and right
.generate
in interface AudioSignal
left
- the left channelright
- the right channel