TracktionEngine
Public Types | Public Member Functions | Public Attributes | List of all members
tracktion::engine::AudioRenderContext Struct Reference

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
 
AudioRenderContextoperator= (const AudioRenderContext &)=delete
 
AudioRenderContextoperator= (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

PlayHeadplayhead
 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...
 
MidiMessageArraybufferForMidiMessages
 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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ ContinuityFlags

Values used in the AudioRenderContext::continuity variable.

Enumerator
contiguous 
playheadJumped 
lastBlockBeforeLoop 
firstBlockOfLoop 

Constructor & Destructor Documentation

◆ AudioRenderContext() [1/3]

tracktion::engine::AudioRenderContext::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() [2/3]

tracktion::engine::AudioRenderContext::AudioRenderContext ( const AudioRenderContext )
default

◆ AudioRenderContext() [3/3]

tracktion::engine::AudioRenderContext::AudioRenderContext ( AudioRenderContext &&  )
default

Member Function Documentation

◆ operator=() [1/2]

AudioRenderContext& tracktion::engine::AudioRenderContext::operator= ( const AudioRenderContext )
delete

◆ operator=() [2/2]

AudioRenderContext& tracktion::engine::AudioRenderContext::operator= ( AudioRenderContext &&  )
delete

◆ isContiguousWithPreviousBlock()

bool tracktion::engine::AudioRenderContext::isContiguousWithPreviousBlock ( ) const
noexcept

◆ isFirstBlockOfLoop()

bool tracktion::engine::AudioRenderContext::isFirstBlockOfLoop ( ) const
noexcept

◆ isLastBlockOfLoop()

bool tracktion::engine::AudioRenderContext::isLastBlockOfLoop ( ) const
noexcept

References continuity, and lastBlockBeforeLoop.

◆ didPlayheadJump()

bool tracktion::engine::AudioRenderContext::didPlayheadJump ( ) const
noexcept

◆ getEditTime()

PlayHead::EditTimeWindow tracktion::engine::AudioRenderContext::getEditTime ( ) const

◆ clearAudioBuffer()

void tracktion::engine::AudioRenderContext::clearAudioBuffer ( ) const
noexcept

Clears the active section of all channels in the audio buffer.

◆ clearMidiBuffer()

void tracktion::engine::AudioRenderContext::clearMidiBuffer ( ) const
noexcept

Clears the active section of the MIDI buffer.

◆ clearAll()

void tracktion::engine::AudioRenderContext::clearAll ( ) const
noexcept

Clears the active section of all channels in the audio and MIDI buffers.

Referenced by tracktion::engine::MuteAudioNode::renderOver().

◆ addAntiDenormalisationNoise()

void tracktion::engine::AudioRenderContext::addAntiDenormalisationNoise ( ) const
noexcept

Applies low-level noise to the audio buffer.

Referenced by tracktion::engine::PluginAudioNode::renderPlugin().

◆ sanityCheck()

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().

Member Data Documentation

◆ playhead

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().

◆ streamTime

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().

◆ destBuffer

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().

◆ destBufferChannels

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().

◆ bufferStartSample

int tracktion::engine::AudioRenderContext::bufferStartSample

◆ bufferNumSamples

int tracktion::engine::AudioRenderContext::bufferNumSamples

◆ bufferForMidiMessages

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().

◆ midiBufferOffset

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().

◆ continuity

int tracktion::engine::AudioRenderContext::continuity

A set of flags to indicate what the relationship is between this block and the previous one.

See also
ContinuityFlags

Referenced by didPlayheadJump(), tracktion::engine::AudioNode::invokeSplitRender(), isContiguousWithPreviousBlock(), isFirstBlockOfLoop(), and isLastBlockOfLoop().

◆ isRendering

bool tracktion::engine::AudioRenderContext::isRendering

The documentation for this struct was generated from the following file: