|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.beadsproject.beads.core.Bead
net.beadsproject.beads.core.UGen
net.beadsproject.beads.core.UGenChain
net.beadsproject.beads.ugens.MultiWrapper
public class MultiWrapper
A generalized multi-channel wrapper for UGens. Can either be used to treat an existing array of UGens as one, big, multi-channel UGen, or to create a multi-channel UGen from newly created UGens.
In the simple case, it just wraps N one-channel UGens into one N-channel UGen.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.beadsproject.beads.core.UGen |
---|
UGen.OutputInitializationRegime, UGen.OutputPauseRegime |
Field Summary |
---|
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs |
Constructor Summary | |
---|---|
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". |
Method Summary | |
---|---|
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. |
Methods inherited from class net.beadsproject.beads.core.UGenChain |
---|
addToChainOutput, addToChainOutput, addToChainOutput, calculateBuffer, drawFromChainInput, drawFromChainInput, drawFromChainInput, postFrame, preFrame |
Methods inherited from class net.beadsproject.beads.core.UGen |
---|
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 |
Methods inherited from class net.beadsproject.beads.core.Bead |
---|
getKillListener, getName, isDeleted, isPaused, kill, message, setKillListener, setName, start, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |