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::ProcessState Struct Reference

Holds the state of a process call. More...

#include "tracktion_TracktionEngineNode.h"

Public Types

enum class  UpdateContinuityFlags { no , yes }
 An enum to indicate if the PlayHeadState continuity should be updated. More...
 

Public Member Functions

 ProcessState (tracktion::graph::PlayHeadState &)
 Creates a ProcessState.
 
 ProcessState (tracktion::graph::PlayHeadState &, const TempoSequence &)
 Creates a ProcessState that will update the editBeatRange field.
 
 ProcessState (tracktion::graph::PlayHeadState &, const tempo::Sequence &)
 Creates a ProcessState that will update the editBeatRange field.
 
void update (double sampleRate, juce::Range< int64_t > referenceSampleRange, UpdateContinuityFlags)
 Updates the internal state based on a reference sample range.
 
void setPlaybackSpeedRatio (double newRatio)
 Sets a playback speed ratio.
 
void setTempoSequence (const tempo::Sequence *)
 Sets the TempoSequence this state utilises.
 
const tempo::Sequence * getTempoSequence () const
 Returns the tempo::Sequence this state has been initialised with one.
 
const tempo::Sequence::PositiongetTempoSequencePosition () const
 Returns the tempo::Sequence::Position this state uses.
 
SyncRange getSyncRange () const
 Returns the SyncRange for the current audio block.
 
SyncPoint getSyncPoint () const
 Returns the end of the SyncRange.
 
void setSyncRange (SyncRange)
 

Public Attributes

std::function< void()> onContinuityUpdated
 Callback which can be set to be called when the continuity changes.
 
tracktion::graph::PlayHeadStateplayHeadState
 
double sampleRate
 
double playbackSpeedRatio
 
int numSamples
 
juce::Range< int64_treferenceSampleRange
 
juce::Range< int64_ttimelineSampleRange
 
TimeRange editTimeRange
 
BeatRange editBeatRange
 

Detailed Description

Holds the state of a process call.

Definition at line 19 of file tracktion_TracktionEngineNode.h.

Member Enumeration Documentation

◆ UpdateContinuityFlags

An enum to indicate if the PlayHeadState continuity should be updated.

Definition at line 31 of file tracktion_TracktionEngineNode.h.

Constructor & Destructor Documentation

◆ ProcessState() [1/3]

tracktion::engine::ProcessState::ProcessState ( tracktion::graph::PlayHeadState phs)

Creates a ProcessState.

Definition at line 14 of file tracktion_TracktionEngineNode.cpp.

◆ ProcessState() [2/3]

tracktion::engine::ProcessState::ProcessState ( tracktion::graph::PlayHeadState phs,
const TempoSequence seq 
)

Creates a ProcessState that will update the editBeatRange field.

Definition at line 19 of file tracktion_TracktionEngineNode.cpp.

◆ ProcessState() [3/3]

tracktion::engine::ProcessState::ProcessState ( tracktion::graph::PlayHeadState phs,
const tempo::Sequence &  seq 
)

Creates a ProcessState that will update the editBeatRange field.

Definition at line 24 of file tracktion_TracktionEngineNode.cpp.

Member Function Documentation

◆ getSyncPoint()

SyncPoint tracktion::engine::ProcessState::getSyncPoint ( ) const

Returns the end of the SyncRange.

See also
getSyncRange

Definition at line 113 of file tracktion_TracktionEngineNode.cpp.

◆ getSyncRange()

SyncRange tracktion::engine::ProcessState::getSyncRange ( ) const

Returns the SyncRange for the current audio block.

Technically, this is only valid during processing but the end of the range can be used to schedule future events assuming the tempo doesn't change between now and the sceduled time.

If the tempo does change, the time will be incorrect but the MonotonicBeat will still be in sync.

Definition at line 118 of file tracktion_TracktionEngineNode.cpp.

◆ getTempoSequence()

const tempo::Sequence * tracktion::engine::ProcessState::getTempoSequence ( ) const

Returns the tempo::Sequence this state has been initialised with one.

Definition at line 103 of file tracktion_TracktionEngineNode.cpp.

◆ getTempoSequencePosition()

const tempo::Sequence::Position * tracktion::engine::ProcessState::getTempoSequencePosition ( ) const

Returns the tempo::Sequence::Position this state uses.

Definition at line 108 of file tracktion_TracktionEngineNode.cpp.

◆ setPlaybackSpeedRatio()

void tracktion::engine::ProcessState::setPlaybackSpeedRatio ( double  newRatio)

Sets a playback speed ratio.

Some Nodes might use this to adjust their playback speeds.

Definition at line 85 of file tracktion_TracktionEngineNode.cpp.

◆ setSyncRange()

void tracktion::engine::ProcessState::setSyncRange ( SyncRange  r)

Definition at line 123 of file tracktion_TracktionEngineNode.cpp.

◆ setTempoSequence()

void tracktion::engine::ProcessState::setTempoSequence ( const tempo::Sequence *  ts)

Sets the TempoSequence this state utilises.

Definition at line 90 of file tracktion_TracktionEngineNode.cpp.

◆ update()

void tracktion::engine::ProcessState::update ( double  sampleRate,
juce::Range< int64_t referenceSampleRange,
UpdateContinuityFlags  updateContinuityFlags 
)

Updates the internal state based on a reference sample range.

Parameters
UpdateContinuityFlagsIf yes, the PlayHeadState will be updated, if no it won't be. If you are calling update more than once in a block, for example to update the reference sample range for timeline position, updating the continuity flags more than once will render it useless as it tracks changes from one call to the next. This flag lets you ensure it is only called once per block.

Definition at line 31 of file tracktion_TracktionEngineNode.cpp.

Member Data Documentation

◆ editBeatRange

BeatRange tracktion::engine::ProcessState::editBeatRange

Definition at line 85 of file tracktion_TracktionEngineNode.h.

◆ editTimeRange

TimeRange tracktion::engine::ProcessState::editTimeRange

Definition at line 84 of file tracktion_TracktionEngineNode.h.

◆ numSamples

int tracktion::engine::ProcessState::numSamples

Definition at line 82 of file tracktion_TracktionEngineNode.h.

◆ onContinuityUpdated

std::function<void()> tracktion::engine::ProcessState::onContinuityUpdated

Callback which can be set to be called when the continuity changes.

This will be made on the audio thread so shouldn't block.

Definition at line 75 of file tracktion_TracktionEngineNode.h.

◆ playbackSpeedRatio

double tracktion::engine::ProcessState::playbackSpeedRatio

Definition at line 81 of file tracktion_TracktionEngineNode.h.

◆ playHeadState

tracktion::graph::PlayHeadState& tracktion::engine::ProcessState::playHeadState

Definition at line 80 of file tracktion_TracktionEngineNode.h.

◆ referenceSampleRange

juce::Range<int64_t> tracktion::engine::ProcessState::referenceSampleRange

Definition at line 83 of file tracktion_TracktionEngineNode.h.

◆ sampleRate

double tracktion::engine::ProcessState::sampleRate

Definition at line 81 of file tracktion_TracktionEngineNode.h.

◆ timelineSampleRange

juce::Range<int64_t> tracktion::engine::ProcessState::timelineSampleRange

Definition at line 83 of file tracktion_TracktionEngineNode.h.


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