TracktionEngine
|
#include <tracktion_EditPlaybackContext.h>
Classes | |
struct | RealtimePriorityDisabler |
Used to temporarily reduce the process priority if a long operation like a file save is taking place. More... | |
struct | ScopedDeviceListReleaser |
Releases and then optionally reallocates the context's device list safely. More... | |
Public Member Functions | |
EditPlaybackContext (TransportControl &) | |
~EditPlaybackContext () | |
void | removeInstanceForDevice (InputDevice &) |
void | addWaveInputDeviceInstance (InputDevice &) |
Note this doesn't check for device enablement. | |
void | addMidiInputDeviceInstance (InputDevice &) |
void | clearNodes () |
void | createPlayAudioNodes (TimePosition startTime) |
void | createPlayAudioNodesIfNeeded (TimePosition startTime) |
void | reallocate () |
bool | isPlaybackGraphAllocated () const |
Returns true if a playback graph is currently allocated. | |
void | prepareForPlaying (TimePosition startTime) |
void | prepareForRecording (TimePosition startTime, TimePosition punchIn) |
void | syncToContext (EditPlaybackContext *contextToSyncTo, TimePosition previousBarTime, TimeDuration syncInterval) |
tl::expected< Clip::Array, juce::String > | stopRecording (InputDeviceInstance &, bool discardRecordings) |
tl::expected< Clip::Array, juce::String > | stopRecording (TimePosition unloopedEnd, bool discardRecordings) |
juce::Result | applyRetrospectiveRecord (juce::Array< Clip * > *clipsCreated=nullptr, bool armedOnly=false) |
juce::Array< InputDeviceInstance * > | getAllInputs () |
InputDeviceInstance * | getInputFor (InputDevice *) const |
OutputDeviceInstance * | getOutputFor (OutputDevice *) const |
bool | isPlaying () const |
bool | isLooping () const |
bool | isDragging () const |
TimePosition | getPosition () const |
TimePosition | getUnloopedPosition () const |
TimeRange | getLoopTimes () const |
int | getLatencySamples () const |
Returns the overall latency of the currently prepared graph. | |
TimePosition | getAudibleTimelineTime () |
double | getSampleRate () const |
void | updateNumCPUs () |
void | setSpeedCompensation (double plusOrMinus) |
This will increase/decrease playback speed by resampling, pitching the output up or down. | |
void | setTempoAdjustment (double plusOrMinusProportion) |
This will increase/decrease playback speed by changing the tempo, maintaining pitch where possible. | |
void | postPosition (TimePosition positionToJumpTo, std::optional< TimePosition > whenToJump={}) |
Posts a transport position change. | |
std::optional< TimePosition > | getPendingPositionChange () const |
Returns a pending position change if there is one. | |
void | play () |
void | stop () |
void | postPlay () |
Posts a transport position change so play can be synconrised with the next block. | |
bool | isPlayPending () const |
Returns true if a play message has been posted but not dispatched. | |
std::optional< SyncPoint > | getSyncPoint () const |
Returns the last reference sample position and the edit time and beat that it corresponded to. | |
TimePosition | globalStreamTimeToEditTime (double) const |
TimePosition | globalStreamTimeToEditTimeUnlooped (double) const |
void | resyncToGlobalStreamTime (juce::Range< double >, double sampleRate) |
tracktion::graph::PlayHead * | getNodePlayHead () const |
void | blockUntilSyncPointChange () |
int | getNumActivelyRecordingDevices () const |
void | incrementNumActivelyRecordingDevices () |
void | decrementNumActivelyRecordingDevices () |
Static Public Member Functions | |
static void | setThreadPoolStrategy (int) |
static int | getThreadPoolStrategy () |
static void | enablePooledMemory (bool) |
Enables reusing of audio buffers during graph processing which may reduce the memory use at the cost of some additional overhead. | |
static void | enableNodeMemorySharing (bool) |
Enables reusing of audio buffers during graph processing which may reduce the memory use at the cost of some additional overhead. | |
static void | enableAudioWorkgroup (bool) |
Enables using AudioWorkgroups. | |
Public Attributes | |
Edit & | edit |
TransportControl & | transport |
LevelMeasurer | masterLevels |
MidiNoteDispatcher | midiDispatcher |
tracktion::engine::EditPlaybackContext::EditPlaybackContext | ( | TransportControl & | ) |
tracktion::engine::EditPlaybackContext::~EditPlaybackContext | ( | ) |
void tracktion::engine::EditPlaybackContext::removeInstanceForDevice | ( | InputDevice & | ) |
void tracktion::engine::EditPlaybackContext::addWaveInputDeviceInstance | ( | InputDevice & | ) |
Note this doesn't check for device enablement.
void tracktion::engine::EditPlaybackContext::addMidiInputDeviceInstance | ( | InputDevice & | ) |
void tracktion::engine::EditPlaybackContext::clearNodes | ( | ) |
void tracktion::engine::EditPlaybackContext::createPlayAudioNodes | ( | TimePosition | startTime | ) |
void tracktion::engine::EditPlaybackContext::createPlayAudioNodesIfNeeded | ( | TimePosition | startTime | ) |
void tracktion::engine::EditPlaybackContext::reallocate | ( | ) |
bool tracktion::engine::EditPlaybackContext::isPlaybackGraphAllocated | ( | ) | const |
Returns true if a playback graph is currently allocated.
void tracktion::engine::EditPlaybackContext::prepareForPlaying | ( | TimePosition | startTime | ) |
void tracktion::engine::EditPlaybackContext::prepareForRecording | ( | TimePosition | startTime, |
TimePosition | punchIn | ||
) |
void tracktion::engine::EditPlaybackContext::syncToContext | ( | EditPlaybackContext * | contextToSyncTo, |
TimePosition | previousBarTime, | ||
TimeDuration | syncInterval | ||
) |
tl::expected< Clip::Array, juce::String > tracktion::engine::EditPlaybackContext::stopRecording | ( | InputDeviceInstance & | , |
bool | discardRecordings | ||
) |
tl::expected< Clip::Array, juce::String > tracktion::engine::EditPlaybackContext::stopRecording | ( | TimePosition | unloopedEnd, |
bool | discardRecordings | ||
) |
juce::Result tracktion::engine::EditPlaybackContext::applyRetrospectiveRecord | ( | juce::Array< Clip * > * | clipsCreated = nullptr , |
bool | armedOnly = false |
||
) |
juce::Array< InputDeviceInstance * > tracktion::engine::EditPlaybackContext::getAllInputs | ( | ) |
InputDeviceInstance * tracktion::engine::EditPlaybackContext::getInputFor | ( | InputDevice * | ) | const |
OutputDeviceInstance * tracktion::engine::EditPlaybackContext::getOutputFor | ( | OutputDevice * | ) | const |
bool tracktion::engine::EditPlaybackContext::isPlaying | ( | ) | const |
bool tracktion::engine::EditPlaybackContext::isLooping | ( | ) | const |
bool tracktion::engine::EditPlaybackContext::isDragging | ( | ) | const |
TimePosition tracktion::engine::EditPlaybackContext::getPosition | ( | ) | const |
TimePosition tracktion::engine::EditPlaybackContext::getUnloopedPosition | ( | ) | const |
TimeRange tracktion::engine::EditPlaybackContext::getLoopTimes | ( | ) | const |
int tracktion::engine::EditPlaybackContext::getLatencySamples | ( | ) | const |
Returns the overall latency of the currently prepared graph.
TimePosition tracktion::engine::EditPlaybackContext::getAudibleTimelineTime | ( | ) |
double tracktion::engine::EditPlaybackContext::getSampleRate | ( | ) | const |
void tracktion::engine::EditPlaybackContext::updateNumCPUs | ( | ) |
void tracktion::engine::EditPlaybackContext::setSpeedCompensation | ( | double | plusOrMinus | ) |
This will increase/decrease playback speed by resampling, pitching the output up or down.
void tracktion::engine::EditPlaybackContext::setTempoAdjustment | ( | double | plusOrMinusProportion | ) |
This will increase/decrease playback speed by changing the tempo, maintaining pitch where possible.
void tracktion::engine::EditPlaybackContext::postPosition | ( | TimePosition | positionToJumpTo, |
std::optional< TimePosition > | whenToJump = {} |
||
) |
Posts a transport position change.
Using the second parameter it's possible to delay position changes in order to quantise them to some musical sense. Pending changes will be cancelled automatically if:
positionToJumpTo | The position to jump to |
whenToJump | The position the playhead should be at when performing the jump |
std::optional< TimePosition > tracktion::engine::EditPlaybackContext::getPendingPositionChange | ( | ) | const |
Returns a pending position change if there is one.
void tracktion::engine::EditPlaybackContext::play | ( | ) |
void tracktion::engine::EditPlaybackContext::stop | ( | ) |
void tracktion::engine::EditPlaybackContext::postPlay | ( | ) |
Posts a transport position change so play can be synconrised with the next block.
bool tracktion::engine::EditPlaybackContext::isPlayPending | ( | ) | const |
Returns true if a play message has been posted but not dispatched.
std::optional< SyncPoint > tracktion::engine::EditPlaybackContext::getSyncPoint | ( | ) | const |
Returns the last reference sample position and the edit time and beat that it corresponded to.
TimePosition tracktion::engine::EditPlaybackContext::globalStreamTimeToEditTime | ( | double | ) | const |
TimePosition tracktion::engine::EditPlaybackContext::globalStreamTimeToEditTimeUnlooped | ( | double | ) | const |
void tracktion::engine::EditPlaybackContext::resyncToGlobalStreamTime | ( | juce::Range< double > | , |
double | sampleRate | ||
) |
tracktion::graph::PlayHead * tracktion::engine::EditPlaybackContext::getNodePlayHead | ( | ) | const |
. Will be removed in a future release.
void tracktion::engine::EditPlaybackContext::blockUntilSyncPointChange | ( | ) |
|
static |
|
static |
|
static |
Enables reusing of audio buffers during graph processing which may reduce the memory use at the cost of some additional overhead.
|
static |
Enables reusing of audio buffers during graph processing which may reduce the memory use at the cost of some additional overhead.
N.B. This is different from enablePooledMemory.
|
static |
Enables using AudioWorkgroups.
Currently experimental and only on macOS.
int tracktion::engine::EditPlaybackContext::getNumActivelyRecordingDevices | ( | ) | const |
void tracktion::engine::EditPlaybackContext::incrementNumActivelyRecordingDevices | ( | ) |
void tracktion::engine::EditPlaybackContext::decrementNumActivelyRecordingDevices | ( | ) |
Edit& tracktion::engine::EditPlaybackContext::edit |
TransportControl& tracktion::engine::EditPlaybackContext::transport |
LevelMeasurer tracktion::engine::EditPlaybackContext::masterLevels |
MidiNoteDispatcher tracktion::engine::EditPlaybackContext::midiDispatcher |