public class MultiWrapper extends UGenChain implements DataBeadReceiver
In the simple case, it just wraps N one-channel UGens into one N-channel UGen.
UGen.OutputInitializationRegime, UGen.OutputPauseRegime
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
MultiWrapper(AudioContext context,
int channels)
Constructor for an multi-channel wrapper for 1-in/1-out UGens on each
channel.
|
MultiWrapper(AudioContext context,
int channels,
int insPerChannel,
int outsPerChannel)
Constructor for an n-channel wrapper for UGens with a certain number
inputs and a certain number outputs on each channel.
|
MultiWrapper(AudioContext context,
UGen[] ugens,
int insPerChannel,
int outsPerChannel)
Constructor for a multi-channel wrapper for an array of UGens that
represent separate "channels".
|
Modifier and Type | Method and Description |
---|---|
void |
addInput(int channelIndex,
int channelUGenInput,
UGen sourceUGen,
int sourceOutput)
A convenience method of adding inputs to specific channel UGens.
|
UGen |
buildUGens(int channelIndex)
Constructs and returns a UGen for each channel.
|
int |
getChannels()
Gets the number of channels.
|
int |
getInsPerChannel()
Gets the number of inputs per channel.
|
int |
getOutsPerChannel()
Gets the number of outs per channel.
|
void |
messageReceived(Bead message)
Forwards Beads to channel UGens.
|
DataBeadReceiver |
sendData(DataBead db)
Forwards a DataBead to all channel UGens.
|
DataBeadReceiver |
sendData(int channel,
DataBead db)
Forwards a DataBead to a specific channel UGen.
|
addToChainOutput, addToChainOutput, addToChainOutput, calculateBuffer, drawFromChainInput, drawFromChainInput, drawFromChainInput, postFrame, preFrame
addDependent, addInput, addInput, clearDependents, clearInputConnections, containsInput, crossfadeInput, getConnectedInputs, getContext, getEnvelopes, getIns, getNumberOfConnectedUGens, getNumberOfDependents, getOutBuffer, getOuts, getTimeTakenLastUpdate, getValue, getValue, getValueDouble, getValueDouble, initializeOuts, isTimerMode, isUpdated, noInputs, pause, printInBuffers, printInputList, printOutBuffers, removeAllConnections, removeConnection, removeDependent, setOutsToPause, setTimerMode, setValue, update, zeroIns, zeroOuts
public MultiWrapper(AudioContext context, int channels)
buildUGens(int)
should be implemented to construct a
UGen for each channel.context
- The audio context.channels
- The number of channels.public MultiWrapper(AudioContext context, int channels, int insPerChannel, int outsPerChannel)
buildUGens(int)
should be implemented to construct a UGen for
each channel.context
- The audio context.channels
- The number of channels.insPerChannel
- The number of inputs per channel UGen.outsPerChannel
- The number of outputs per channel UGen.public MultiWrapper(AudioContext context, UGen[] ugens, int insPerChannel, int outsPerChannel)
context
- The audio context.ugens
- The array of UGens to wrap.insPerChannel
- The number of inputs per channel.outsPerChannel
- The number of ouputs per channel.public UGen buildUGens(int channelIndex)
channelIndex
- The index of the channel for which the UGen is being created.public void addInput(int channelIndex, int channelUGenInput, UGen sourceUGen, int sourceOutput)
addInput(c, i, sUGen, o)
is equivalent to calling
addInput(c * insPerChannel + i, sUGen, o)
.
channelIndex
- The channel to call addInput on.channelUGenInput
- The input index of the channel UGen.sourceUGen
- The source UGen.sourceOutput
- The output of the source UGen.public DataBeadReceiver sendData(DataBead db)
DataBeadReceiver.sendData(DataBead)
;
otherwise it calls Bead.message(Bead)
.sendData
in interface DataBeadReceiver
db
- The DataBead.this
.public DataBeadReceiver sendData(int channel, DataBead db)
DataBeadReceiver.sendData(DataBead)
;
otherwise it calls Bead.message(Bead)
.channel
- The index of the channel UGen to which to forward the
DataBead.db
- The DataBead.public void messageReceived(Bead message)
message
is a DataBead
and the channel UGens are DataBeadReceivers, it calls
DataBeadReceiver.sendData(DataBead)
; otherwise it calls
Bead.message(Bead)
.messageReceived
in class Bead
message
- the messagepublic int getChannels()
public int getInsPerChannel()
public int getOutsPerChannel()