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

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

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. More...
 
 ProcessState (tracktion::graph::PlayHeadState &, const TempoSequence &)
 Creates a ProcessState that will update the editBeatRange field. More...
 
 ProcessState (tracktion::graph::PlayHeadState &, const tempo::Sequence &)
 Creates a ProcessState that will update the editBeatRange field. More...
 
void update (double sampleRate, juce::Range< int64_t > referenceSampleRange, UpdateContinuityFlags)
 Updates the internal state based on a reference sample range. More...
 
void setPlaybackSpeedRatio (double newRatio)
 Sets a playback speed ratio. More...
 
void setTempoSequence (const tempo::Sequence *)
 Sets the TempoSequence this state utilises. More...
 
const tempo::Sequence * getTempoSequence () const
 Returns the tempo::Sequence this state has been initialised with one. More...
 
const tempo::Sequence::Position * getTempoSequencePosition () const
 Returns the tempo::Sequence::Position this state uses. More...
 

Public Attributes

tracktion::graph::PlayHeadStateplayHeadState
 
double sampleRate = 44100.0
 
double playbackSpeedRatio = 1.0
 
int numSamples = 0
 
juce::Range< int64_t > referenceSampleRange
 
juce::Range< int64_t > timelineSampleRange
 
TimeRange editTimeRange
 
BeatRange editBeatRange
 

Detailed Description

Holds the state of a process call.

Member Enumeration Documentation

◆ UpdateContinuityFlags

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

Enumerator
no 
yes 

Constructor & Destructor Documentation

◆ ProcessState() [1/3]

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

Creates a ProcessState.

◆ ProcessState() [2/3]

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

Creates a ProcessState that will update the editBeatRange field.

◆ ProcessState() [3/3]

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

Creates a ProcessState that will update the editBeatRange field.

Member Function Documentation

◆ update()

void tracktion::engine::ProcessState::update ( double  sampleRate,
juce::Range< int64_t >  referenceSampleRange,
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.

Referenced by tracktion::engine::MultiThreadedNodePlayer::process().

◆ setPlaybackSpeedRatio()

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

Sets a playback speed ratio.

Some Nodes might use this to adjust their playback speeds.

◆ setTempoSequence()

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

Sets the TempoSequence this state utilises.

◆ getTempoSequence()

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

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

◆ getTempoSequencePosition()

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

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

Member Data Documentation

◆ playHeadState

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

◆ sampleRate

double tracktion::engine::ProcessState::sampleRate = 44100.0

◆ playbackSpeedRatio

double tracktion::engine::ProcessState::playbackSpeedRatio = 1.0

◆ numSamples

int tracktion::engine::ProcessState::numSamples = 0

◆ referenceSampleRange

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

◆ timelineSampleRange

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

◆ editTimeRange

TimeRange tracktion::engine::ProcessState::editTimeRange

◆ editBeatRange

BeatRange tracktion::engine::ProcessState::editBeatRange

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