TracktionEngine
|
Rendering target info. More...
Public Types | |
enum | ContinuityFlags { contiguous = 1 , playheadJumped = 2 , lastBlockBeforeLoop = 4 , firstBlockOfLoop = 8 } |
Values used in the AudioRenderContext::continuity variable. More... | |
Public Member Functions | |
AudioRenderContext (PlayHead &ph, legacy::EditTimeRange stream, juce::AudioBuffer< float > *buffer, const juce::AudioChannelSet &bufferChannels, int bufferStart, int bufferSize, MidiMessageArray *midiBuffer, double midiOffset, int continuityFlags, bool rendering) noexcept | |
AudioRenderContext (const AudioRenderContext &)=default | |
AudioRenderContext (AudioRenderContext &&)=default | |
AudioRenderContext & | operator= (const AudioRenderContext &)=delete |
AudioRenderContext & | operator= (AudioRenderContext &&)=delete |
bool | isContiguousWithPreviousBlock () const noexcept |
bool | isFirstBlockOfLoop () const noexcept |
bool | isLastBlockOfLoop () const noexcept |
bool | didPlayheadJump () const noexcept |
PlayHead::EditTimeWindow | getEditTime () const |
Returns the section of the edit that needs to be rendered by this block. More... | |
void | clearAudioBuffer () const noexcept |
Clears the active section of all channels in the audio buffer. More... | |
void | clearMidiBuffer () const noexcept |
Clears the active section of the MIDI buffer. More... | |
void | clearAll () const noexcept |
Clears the active section of all channels in the audio and MIDI buffers. More... | |
void | addAntiDenormalisationNoise () const noexcept |
Applies low-level noise to the audio buffer. More... | |
void | sanityCheck () const |
Does a quick check on the bounds of various values in the structure. More... | |
Public Attributes | |
PlayHead & | playhead |
The playhead provides information about current time, tempo etc at the block being rendered. More... | |
legacy::EditTimeRange | streamTime |
The time window which needs to be rendered into the current block. More... | |
juce::AudioBuffer< float > * | destBuffer |
The target audio buffer which needs to be filled. More... | |
juce::AudioChannelSet | destBufferChannels |
A description of the type of channels in each of the channels in destBuffer. More... | |
int | bufferStartSample |
The index of the start point in the audio buffer from which data must be written. More... | |
int | bufferNumSamples |
The number of samples to write into the audio buffer. More... | |
MidiMessageArray * | bufferForMidiMessages |
A buffer of MIDI events to process. More... | |
double | midiBufferOffset |
A time offset to add to the timestamp of any events in the MIDI buffer. More... | |
int | continuity |
A set of flags to indicate what the relationship is between this block and the previous one. More... | |
bool | isRendering |
True if the rendering is happening as part of an offline render rather than live playback. More... | |
Rendering target info.
If addValuesToExistingBufferContents is true, the method must add its data to the buffer's contents, otherwise it must overwrite it, as the buffers' contents will be undefined.
Any midi messages added to the midi buffer must have timestamps relative to the start of this block + the midiBufferOffset value.
Either the audio or midi buffers passed in may be null if that kind of data isn't required by the caller.
Values used in the AudioRenderContext::continuity variable.
Enumerator | |
---|---|
contiguous | |
playheadJumped | |
lastBlockBeforeLoop | |
firstBlockOfLoop |
|
noexcept |
|
default |
|
default |
|
delete |
|
delete |
|
noexcept |
References contiguous, and continuity.
Referenced by tracktion::engine::PluginAudioNode::renderPlugin(), and tracktion::engine::SubSampleWaveAudioNode::renderSection().
|
noexcept |
References continuity, and firstBlockOfLoop.
Referenced by tracktion::engine::SubSampleWaveAudioNode::renderSection().
|
noexcept |
References continuity, and lastBlockBeforeLoop.
|
noexcept |
References continuity, and playheadJumped.
Referenced by tracktion::engine::PluginAudioNode::renderAdding(), and tracktion::engine::PluginAudioNode::renderOver().
PlayHead::EditTimeWindow tracktion::engine::AudioRenderContext::getEditTime | ( | ) | const |
Returns the section of the edit that needs to be rendered by this block.
Referenced by tracktion::engine::PluginAudioNode::createPluginRenderContext(), tracktion::engine::AudioNode::invokeSplitRender(), tracktion::engine::PluginAudioNode::prepareForNextBlock(), tracktion::engine::SubSampleWaveAudioNode::prepareForNextBlock(), and tracktion::engine::PluginAudioNode::renderPlugin().
|
noexcept |
Clears the active section of all channels in the audio buffer.
|
noexcept |
Clears the active section of the MIDI buffer.
|
noexcept |
Clears the active section of all channels in the audio and MIDI buffers.
Referenced by tracktion::engine::MuteAudioNode::renderOver().
|
noexcept |
Applies low-level noise to the audio buffer.
Referenced by tracktion::engine::PluginAudioNode::renderPlugin().
void tracktion::engine::AudioRenderContext::sanityCheck | ( | ) | const |
Does a quick check on the bounds of various values in the structure.
References bufferStartSample, and destBuffer.
Referenced by tracktion::engine::SubSampleWaveAudioNode::renderSection().
PlayHead& tracktion::engine::AudioRenderContext::playhead |
The playhead provides information about current time, tempo etc at the block being rendered.
Referenced by tracktion::engine::PluginAudioNode::createPluginRenderContext(), tracktion::engine::AudioNode::invokeSplitRender(), and tracktion::engine::SubSampleWaveAudioNode::renderSection().
legacy::EditTimeRange tracktion::engine::AudioRenderContext::streamTime |
The time window which needs to be rendered into the current block.
This is a monotonically increasing window, even if playback is paused. To find out what section of the edit needs to be rendered, Playhead provides conversion methods such as Playhead::streamTimeToEditWindow() or getEditTime()
Referenced by tracktion::engine::AudioNode::invokeSplitRender(), tracktion::engine::PluginAudioNode::renderOver(), and tracktion::engine::SpeedRampAudioNode::renderSection().
juce::AudioBuffer<float>* tracktion::engine::AudioRenderContext::destBuffer |
The target audio buffer which needs to be filled.
This may be nullptr if no audio is being processed.
Referenced by tracktion::engine::PluginAudioNode::createPluginRenderContext(), tracktion::engine::SubSampleWaveAudioNode::renderSection(), and sanityCheck().
juce::AudioChannelSet tracktion::engine::AudioRenderContext::destBufferChannels |
A description of the type of channels in each of the channels in destBuffer.
Referenced by tracktion::engine::PluginAudioNode::createPluginRenderContext().
int tracktion::engine::AudioRenderContext::bufferStartSample |
The index of the start point in the audio buffer from which data must be written.
Referenced by tracktion::engine::PluginAudioNode::createPluginRenderContext(), tracktion::engine::AudioNode::invokeSplitRender(), tracktion::engine::SubSampleWaveAudioNode::renderSection(), tracktion::engine::SpeedRampAudioNode::renderSection(), and sanityCheck().
int tracktion::engine::AudioRenderContext::bufferNumSamples |
The number of samples to write into the audio buffer.
Referenced by tracktion::engine::PluginAudioNode::createPluginRenderContext(), tracktion::engine::AudioNode::invokeSplitRender(), tracktion::engine::SubSampleWaveAudioNode::renderSection(), tracktion::engine::SpeedRampAudioNode::renderSection(), and tracktion::engine::TimedMutingAudioNode::renderSection().
MidiMessageArray* tracktion::engine::AudioRenderContext::bufferForMidiMessages |
A buffer of MIDI events to process.
This may be nullptr if no MIDI is being sent
Referenced by tracktion::engine::PluginAudioNode::createPluginRenderContext().
double tracktion::engine::AudioRenderContext::midiBufferOffset |
A time offset to add to the timestamp of any events in the MIDI buffer.
Referenced by tracktion::engine::PluginAudioNode::createPluginRenderContext(), and tracktion::engine::AudioNode::invokeSplitRender().
int tracktion::engine::AudioRenderContext::continuity |
A set of flags to indicate what the relationship is between this block and the previous one.
Referenced by didPlayheadJump(), tracktion::engine::AudioNode::invokeSplitRender(), isContiguousWithPreviousBlock(), isFirstBlockOfLoop(), and isLastBlockOfLoop().
bool tracktion::engine::AudioRenderContext::isRendering |
True if the rendering is happening as part of an offline render rather than live playback.
Referenced by tracktion::engine::PluginAudioNode::createPluginRenderContext(), tracktion::engine::PluginAudioNode::renderAdding(), tracktion::engine::PluginAudioNode::renderOver(), and tracktion::engine::SubSampleWaveAudioNode::renderSection().