TracktionEngine
|
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::Position * | getTempoSequencePosition () 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::PlayHeadState & | playHeadState |
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 |
Holds the state of a process call.
|
strong |
An enum to indicate if the PlayHeadState continuity should be updated.
Enumerator | |
---|---|
no | |
yes |
tracktion::engine::ProcessState::ProcessState | ( | tracktion::graph::PlayHeadState & | ) |
Creates a ProcessState.
tracktion::engine::ProcessState::ProcessState | ( | tracktion::graph::PlayHeadState & | , |
const TempoSequence & | |||
) |
Creates a ProcessState that will update the editBeatRange field.
tracktion::engine::ProcessState::ProcessState | ( | tracktion::graph::PlayHeadState & | , |
const tempo::Sequence & | |||
) |
Creates a ProcessState that will update the editBeatRange field.
void tracktion::engine::ProcessState::update | ( | double | sampleRate, |
juce::Range< int64_t > | referenceSampleRange, | ||
UpdateContinuityFlags | |||
) |
Updates the internal state based on a reference sample range.
UpdateContinuityFlags | If 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().
void tracktion::engine::ProcessState::setPlaybackSpeedRatio | ( | double | newRatio | ) |
Sets a playback speed ratio.
Some Nodes might use this to adjust their playback speeds.
void tracktion::engine::ProcessState::setTempoSequence | ( | const tempo::Sequence * | ) |
Sets the TempoSequence this state utilises.
const tempo::Sequence * tracktion::engine::ProcessState::getTempoSequence | ( | ) | const |
Returns the tempo::Sequence this state has been initialised with one.
const tempo::Sequence::Position * tracktion::engine::ProcessState::getTempoSequencePosition | ( | ) | const |
Returns the tempo::Sequence::Position this state uses.
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.
SyncPoint tracktion::engine::ProcessState::getSyncPoint | ( | ) | const |
Returns the end of the SyncRange.
void tracktion::engine::ProcessState::setSyncRange | ( | SyncRange | ) |
.
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.
tracktion::graph::PlayHeadState& tracktion::engine::ProcessState::playHeadState |
Referenced by tracktion::engine::TracktionEngineNode::getPlayHeadState().
double tracktion::engine::ProcessState::sampleRate = 44100.0 |
double tracktion::engine::ProcessState::playbackSpeedRatio = 1.0 |
int tracktion::engine::ProcessState::numSamples = 0 |
Referenced by tracktion::engine::TracktionEngineNode::getNumSamples().
juce::Range<int64_t> tracktion::engine::ProcessState::referenceSampleRange |
juce::Range<int64_t> tracktion::engine::ProcessState::timelineSampleRange |
TimeRange tracktion::engine::ProcessState::editTimeRange |
BeatRange tracktion::engine::ProcessState::editBeatRange |
Referenced by tracktion::engine::TracktionEngineNode::getEditBeatRange().