|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ddf.minim.SignalChain
public class SignalChain
An 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 Summary | |
---|---|
SignalChain()
Constructs an empty SignalChain . |
Method Summary | |
---|---|
void |
add(AudioSignal signal)
Adds signal to the end of the chain. |
void |
clear()
Removes all signals from the effect chain. |
boolean |
contains(AudioSignal s)
Returns true if s is in the chain. |
void |
disable(AudioSignal signal)
Disables signal if it is in the chain. |
void |
disable(int i)
Disables the i th effect in the chain. |
void |
disableAll()
Disables all signals in the chain. |
void |
enable(AudioSignal signal)
Enables signal if it is in the chain. |
void |
enable(int i)
Enables the i th effect in the chain. |
void |
enableAll()
Enables all signals in the chain. |
void |
generate(float[] signal)
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)
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)
Gets the ith signal in the chain. |
boolean |
hasEnabled()
Returns true if at least one effect in the chain is enabled. |
boolean |
isEnabled(AudioSignal signal)
Returns true if e is in the chain and is enabled. |
void |
remove(AudioSignal signal)
Removes signal from the chain. |
AudioSignal |
remove(int i)
Removes and returns the i th signal from the
chain. |
int |
size()
Returns the number of signals in the chain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SignalChain()
SignalChain
.
Method Detail |
---|
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 remove
AudioSignal
that was removedpublic AudioSignal get(int i)
ith
signal in the chain.
i
- the index of the AudioSignal
to getpublic boolean contains(AudioSignal s)
s
is in the chain.
s
- the AudioSignal
to check for
s
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 of
signal
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |