11namespace tracktion {
inline namespace engine
18AudioNode::~AudioNode()
22void AudioNode::callRenderAdding (
const AudioRenderContext& rc)
28void AudioNode::callRenderOverForMidi (
const AudioRenderContext& rc)
30 if (rc.bufferForMidiMessages ==
nullptr || rc.bufferForMidiMessages->isEmpty())
36 MidiMessageArray temp;
38 AudioRenderContext rc2 (rc);
39 rc2.bufferForMidiMessages = &temp;
43 rc.bufferForMidiMessages->mergeFromAndClear (temp);
47void AudioNode::callRenderOver (
const AudioRenderContext& rc)
49 if (rc.destBuffer !=
nullptr)
51 AudioScratchBuffer scratch (rc.destBuffer->getNumChannels(), rc.bufferNumSamples);
53 AudioRenderContext rc2 (rc);
54 rc2.destBuffer = &scratch.buffer;
55 rc2.bufferStartSample = 0;
57 callRenderOverForMidi (rc2);
59 for (
int i = rc.destBuffer->getNumChannels(); --i >= 0;)
60 rc.destBuffer->addFrom (i, rc.bufferStartSample, *rc2.destBuffer, i, 0, rc.bufferNumSamples);
64 callRenderOverForMidi (rc);
98SingleInputAudioNode::SingleInputAudioNode (
AudioNode* n) : input (n)
105 input->getAudioNodeProperties (info);
110 input->prepareAudioNodeToPlay (info);
115 return input->purgeSubNodes (keepAudio, keepMidi);
120 input->releaseAudioNodeResources();
123void SingleInputAudioNode::visitNodes (
const VisitorFn& v)
126 input->visitNodes (v);
129Plugin::Ptr SingleInputAudioNode::getPlugin()
const
131 return input->getPlugin();
134void SingleInputAudioNode::prepareForNextBlock (
const AudioRenderContext& rc)
136 input->prepareForNextBlock (rc);
139bool SingleInputAudioNode::isReadyToRender()
141 return input->isReadyToRender();
144void SingleInputAudioNode::renderOver (
const AudioRenderContext& rc)
146 input->renderOver (rc);
149void SingleInputAudioNode::renderAdding (
const AudioRenderContext& rc)
151 input->renderAdding (rc);
Base class for nodes in an audio playback graph.
Holds some really basic properties of a node.
Passed into AudioNodes when they are being initialised, to give them useful contextual information th...
int bufferNumSamples
The number of samples to write into the audio buffer.
void addAntiDenormalisationNoise() const noexcept
Applies low-level noise to the audio buffer.
MidiMessageArray * bufferForMidiMessages
A buffer of MIDI events to process.
void clearAll() const noexcept
Clears the active section of all channels in the audio and MIDI buffers.
int bufferStartSample
The index of the start point in the audio buffer from which data must be written.
PlayHead & playhead
The playhead provides information about current time, tempo etc at the block being rendered.
juce::AudioBuffer< float > * destBuffer
The target audio buffer which needs to be filled.
void clearAudioBuffer() const noexcept
Clears the active section of all channels in the audio buffer.
PlayHead::EditTimeWindow getEditTime() const
Returns the section of the edit that needs to be rendered by this block.
void clearMidiBuffer() const noexcept
Clears the active section of the MIDI buffer.
legacy::EditTimeRange streamTime
The time window which needs to be rendered into the current block.