public abstract class DelayEvent extends UGen
trigger()
method is called when the delay
time has elapsed. DelayEvent is the base class for DelayTrigger
(used to send
Bead messages) and DelayData
(used to send DataBeads).UGen.OutputInitializationRegime, UGen.OutputPauseRegime
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
DelayEvent(AudioContext context,
double delay)
Instantiates a new DelayEvent with the specified millisecond delay and
receiver.
|
DelayEvent(AudioContext context,
double delay,
boolean triggerAfter)
Instantiates a new DelayEvent with the specified millisecond delay and
receiver.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data.
|
double |
getCount()
Gets the current count.
|
double |
getSampleDelay()
Gets the sample delay.
|
boolean |
isTriggeredAfter()
Returns
true if the DelayEvent is triggered during the frame
after the delay time expires; returns false if it is
triggered during the frame in which the delay time expires. |
void |
reset()
Reset timer to zero.
|
DelayEvent |
setSampleDelay(float sampleDelay)
Sets the sample delay; this may cause the DelayEvent to trigger
immediately.
|
abstract void |
trigger()
Called when the delay time has elapsed.
|
DelayEvent |
triggeredAfter(boolean f)
Sets whether the Delay event fires during the frame in which the delay
time expires (
false , the default), or the frame after (
true ). |
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
getKillListener, getName, isDeleted, isPaused, kill, message, messageReceived, setKillListener, setName, start, toString
public DelayEvent(AudioContext context, double delay)
context
- The audio context.delay
- The delay time in milliseconds.receiver
- The receiver.public DelayEvent(AudioContext context, double delay, boolean triggerAfter)
triggerAfter
indicates whether the object is
triggered at the beginning of the frame in which the delay time elapses (
false
), or after (true
).context
- The audio context.delay
- The delay in milliseconds.receiver
- The receiver.triggerAfter
- Whether the object fires just before or just after the delay
time expires.public void reset()
public void calculateBuffer()
UGen
UGen.bufIn
and putting data
into UGen.bufOut
in some way. UGen.bufIn
and UGen.bufOut
are 2D arrays of floats of the form float[numChannels][bufferSize]. The length of the buffers is given by
UGen.bufferSize
, and the number of channels of the input and output buffers are given by UGen.ins
and UGen.outs
respectively.calculateBuffer
in class UGen
public abstract void trigger()
public double getSampleDelay()
public DelayEvent setSampleDelay(float sampleDelay)
sampleDelay
- The new sample delay in milliseconds.public double getCount()
public boolean isTriggeredAfter()
true
if the DelayEvent is triggered during the frame
after the delay time expires; returns false
if it is
triggered during the frame in which the delay time expires.public DelayEvent triggeredAfter(boolean f)
false
, the default), or the frame after (
true
).f
- Whether to fire after the frame when the delay time expires.