tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
tracktion::engine::AudioRenderContext Struct Reference

Rendering target info. More...

#include "tracktion_AudioNode.h"

Public Types

enum  ContinuityFlags { contiguous , playheadJumped , lastBlockBeforeLoop , firstBlockOfLoop }
 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.
 
void clearAudioBuffer () const noexcept
 Clears the active section of all channels in the audio buffer.
 
void clearMidiBuffer () const noexcept
 Clears the active section of the MIDI buffer.
 
void clearAll () const noexcept
 Clears the active section of all channels in the audio and MIDI buffers.
 
void addAntiDenormalisationNoise () const noexcept
 Applies low-level noise to the audio buffer.
 
void sanityCheck () const
 Does a quick check on the bounds of various values in the structure.
 

Public Attributes

PlayHeadplayhead
 The playhead provides information about current time, tempo etc at the block being rendered.
 
legacy::EditTimeRange streamTime
 The time window which needs to be rendered into the current block.
 
juce::AudioBuffer< float > * destBuffer
 The target audio buffer which needs to be filled.
 
juce::AudioChannelSet destBufferChannels
 A description of the type of channels in each of the channels in destBuffer.
 
int bufferStartSample
 The index of the start point in the audio buffer from which data must be written.
 
int bufferNumSamples
 The number of samples to write into the audio buffer.
 
MidiMessageArraybufferForMidiMessages
 A buffer of MIDI events to process.
 
double midiBufferOffset
 A time offset to add to the timestamp of any events in the MIDI buffer.
 
int continuity
 A set of flags to indicate what the relationship is between this block and the previous one.
 
bool isRendering
 True if the rendering is happening as part of an offline render rather than live playback.
 

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.

Definition at line 70 of file tracktion_AudioNode.h.

Member Enumeration Documentation

◆ ContinuityFlags

Values used in the AudioRenderContext::continuity variable.

Definition at line 127 of file tracktion_AudioNode.h.

Constructor & Destructor Documentation

◆ AudioRenderContext()

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

Definition at line 73 of file tracktion_AudioNode.h.

Member Function Documentation

◆ addAntiDenormalisationNoise()

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

Applies low-level noise to the audio buffer.

Definition at line 74 of file tracktion_AudioNode.cpp.

◆ clearAll()

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

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

Definition at line 86 of file tracktion_AudioNode.cpp.

◆ clearAudioBuffer()

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

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

Definition at line 68 of file tracktion_AudioNode.cpp.

◆ clearMidiBuffer()

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

Clears the active section of the MIDI buffer.

Definition at line 80 of file tracktion_AudioNode.cpp.

◆ didPlayheadJump()

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

Definition at line 143 of file tracktion_AudioNode.h.

◆ getEditTime()

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

Returns the section of the edit that needs to be rendered by this block.

Definition at line 92 of file tracktion_AudioNode.cpp.

◆ isContiguousWithPreviousBlock()

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

Definition at line 140 of file tracktion_AudioNode.h.

◆ isFirstBlockOfLoop()

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

Definition at line 141 of file tracktion_AudioNode.h.

◆ isLastBlockOfLoop()

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

Definition at line 142 of file tracktion_AudioNode.h.

◆ sanityCheck()

void tracktion::engine::AudioRenderContext::sanityCheck ( ) const

Does a quick check on the bounds of various values in the structure.

Definition at line 162 of file tracktion_AudioNode.h.

Member Data Documentation

◆ bufferForMidiMessages

MidiMessageArray* tracktion::engine::AudioRenderContext::bufferForMidiMessages

A buffer of MIDI events to process.

This may be nullptr if no MIDI is being sent

Definition at line 121 of file tracktion_AudioNode.h.

◆ bufferNumSamples

int tracktion::engine::AudioRenderContext::bufferNumSamples

The number of samples to write into the audio buffer.

Definition at line 116 of file tracktion_AudioNode.h.

◆ bufferStartSample

int tracktion::engine::AudioRenderContext::bufferStartSample

The index of the start point in the audio buffer from which data must be written.

Definition at line 113 of file tracktion_AudioNode.h.

◆ 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

Definition at line 138 of file tracktion_AudioNode.h.

◆ 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.

Definition at line 107 of file tracktion_AudioNode.h.

◆ destBufferChannels

juce::AudioChannelSet tracktion::engine::AudioRenderContext::destBufferChannels

A description of the type of channels in each of the channels in destBuffer.

Definition at line 110 of file tracktion_AudioNode.h.

◆ isRendering

bool tracktion::engine::AudioRenderContext::isRendering

True if the rendering is happening as part of an offline render rather than live playback.

Definition at line 146 of file tracktion_AudioNode.h.

◆ midiBufferOffset

double tracktion::engine::AudioRenderContext::midiBufferOffset

A time offset to add to the timestamp of any events in the MIDI buffer.

Definition at line 124 of file tracktion_AudioNode.h.

◆ playhead

PlayHead& tracktion::engine::AudioRenderContext::playhead

The playhead provides information about current time, tempo etc at the block being rendered.

Definition at line 95 of file tracktion_AudioNode.h.

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

Definition at line 102 of file tracktion_AudioNode.h.


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