TracktionEngine
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tracktion::engine::EditPlaybackContext Class Reference

#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 ()
 
InputDeviceInstancegetInputFor (InputDevice *) const
 
OutputDeviceInstancegetOutputFor (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< SyncPointgetSyncPoint () 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::PlayHeadgetNodePlayHead () 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

Editedit
 
TransportControltransport
 
LevelMeasurer masterLevels
 
MidiNoteDispatcher midiDispatcher
 

Constructor & Destructor Documentation

◆ EditPlaybackContext()

tracktion::engine::EditPlaybackContext::EditPlaybackContext ( TransportControl )

◆ ~EditPlaybackContext()

tracktion::engine::EditPlaybackContext::~EditPlaybackContext ( )

Member Function Documentation

◆ removeInstanceForDevice()

void tracktion::engine::EditPlaybackContext::removeInstanceForDevice ( InputDevice )

◆ addWaveInputDeviceInstance()

void tracktion::engine::EditPlaybackContext::addWaveInputDeviceInstance ( InputDevice )

Note this doesn't check for device enablement.

◆ addMidiInputDeviceInstance()

void tracktion::engine::EditPlaybackContext::addMidiInputDeviceInstance ( InputDevice )

◆ clearNodes()

void tracktion::engine::EditPlaybackContext::clearNodes ( )

◆ createPlayAudioNodes()

void tracktion::engine::EditPlaybackContext::createPlayAudioNodes ( TimePosition  startTime)

◆ createPlayAudioNodesIfNeeded()

void tracktion::engine::EditPlaybackContext::createPlayAudioNodesIfNeeded ( TimePosition  startTime)

◆ reallocate()

void tracktion::engine::EditPlaybackContext::reallocate ( )

◆ isPlaybackGraphAllocated()

bool tracktion::engine::EditPlaybackContext::isPlaybackGraphAllocated ( ) const

Returns true if a playback graph is currently allocated.

◆ prepareForPlaying()

void tracktion::engine::EditPlaybackContext::prepareForPlaying ( TimePosition  startTime)

◆ prepareForRecording()

void tracktion::engine::EditPlaybackContext::prepareForRecording ( TimePosition  startTime,
TimePosition  punchIn 
)

◆ syncToContext()

void tracktion::engine::EditPlaybackContext::syncToContext ( EditPlaybackContext contextToSyncTo,
TimePosition  previousBarTime,
TimeDuration  syncInterval 
)

◆ stopRecording() [1/2]

tl::expected< Clip::Array, juce::String > tracktion::engine::EditPlaybackContext::stopRecording ( InputDeviceInstance ,
bool  discardRecordings 
)

◆ stopRecording() [2/2]

tl::expected< Clip::Array, juce::String > tracktion::engine::EditPlaybackContext::stopRecording ( TimePosition  unloopedEnd,
bool  discardRecordings 
)

◆ applyRetrospectiveRecord()

juce::Result tracktion::engine::EditPlaybackContext::applyRetrospectiveRecord ( juce::Array< Clip * > *  clipsCreated = nullptr,
bool  armedOnly = false 
)

◆ getAllInputs()

juce::Array< InputDeviceInstance * > tracktion::engine::EditPlaybackContext::getAllInputs ( )

◆ getInputFor()

InputDeviceInstance * tracktion::engine::EditPlaybackContext::getInputFor ( InputDevice ) const

◆ getOutputFor()

OutputDeviceInstance * tracktion::engine::EditPlaybackContext::getOutputFor ( OutputDevice ) const

◆ isPlaying()

bool tracktion::engine::EditPlaybackContext::isPlaying ( ) const

◆ isLooping()

bool tracktion::engine::EditPlaybackContext::isLooping ( ) const

◆ isDragging()

bool tracktion::engine::EditPlaybackContext::isDragging ( ) const

◆ getPosition()

TimePosition tracktion::engine::EditPlaybackContext::getPosition ( ) const

◆ getUnloopedPosition()

TimePosition tracktion::engine::EditPlaybackContext::getUnloopedPosition ( ) const

◆ getLoopTimes()

TimeRange tracktion::engine::EditPlaybackContext::getLoopTimes ( ) const

◆ getLatencySamples()

int tracktion::engine::EditPlaybackContext::getLatencySamples ( ) const

Returns the overall latency of the currently prepared graph.

◆ getAudibleTimelineTime()

TimePosition tracktion::engine::EditPlaybackContext::getAudibleTimelineTime ( )

◆ getSampleRate()

double tracktion::engine::EditPlaybackContext::getSampleRate ( ) const

◆ updateNumCPUs()

void tracktion::engine::EditPlaybackContext::updateNumCPUs ( )

◆ setSpeedCompensation()

void tracktion::engine::EditPlaybackContext::setSpeedCompensation ( double  plusOrMinus)

This will increase/decrease playback speed by resampling, pitching the output up or down.

◆ setTempoAdjustment()

void tracktion::engine::EditPlaybackContext::setTempoAdjustment ( double  plusOrMinusProportion)

This will increase/decrease playback speed by changing the tempo, maintaining pitch where possible.

◆ postPosition()

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:

  • The transport is stopped
  • The playhead reaches the end of a loop position
  • The playhead passes the jump position
Parameters
positionToJumpToThe position to jump to
whenToJumpThe position the playhead should be at when performing the jump

◆ getPendingPositionChange()

std::optional< TimePosition > tracktion::engine::EditPlaybackContext::getPendingPositionChange ( ) const

Returns a pending position change if there is one.

◆ play()

void tracktion::engine::EditPlaybackContext::play ( )

◆ stop()

void tracktion::engine::EditPlaybackContext::stop ( )

◆ postPlay()

void tracktion::engine::EditPlaybackContext::postPlay ( )

Posts a transport position change so play can be synconrised with the next block.

◆ isPlayPending()

bool tracktion::engine::EditPlaybackContext::isPlayPending ( ) const

Returns true if a play message has been posted but not dispatched.

◆ getSyncPoint()

std::optional< SyncPoint > tracktion::engine::EditPlaybackContext::getSyncPoint ( ) const

Returns the last reference sample position and the edit time and beat that it corresponded to.

◆ globalStreamTimeToEditTime()

TimePosition tracktion::engine::EditPlaybackContext::globalStreamTimeToEditTime ( double  ) const

◆ globalStreamTimeToEditTimeUnlooped()

TimePosition tracktion::engine::EditPlaybackContext::globalStreamTimeToEditTimeUnlooped ( double  ) const

◆ resyncToGlobalStreamTime()

void tracktion::engine::EditPlaybackContext::resyncToGlobalStreamTime ( juce::Range< double >  ,
double  sampleRate 
)

◆ getNodePlayHead()

tracktion::graph::PlayHead * tracktion::engine::EditPlaybackContext::getNodePlayHead ( ) const

. Will be removed in a future release.

◆ blockUntilSyncPointChange()

void tracktion::engine::EditPlaybackContext::blockUntilSyncPointChange ( )

◆ setThreadPoolStrategy()

static void tracktion::engine::EditPlaybackContext::setThreadPoolStrategy ( int  )
static

◆ getThreadPoolStrategy()

static int tracktion::engine::EditPlaybackContext::getThreadPoolStrategy ( )
static

◆ enablePooledMemory()

static void tracktion::engine::EditPlaybackContext::enablePooledMemory ( bool  )
static

Enables reusing of audio buffers during graph processing which may reduce the memory use at the cost of some additional overhead.

◆ enableNodeMemorySharing()

static void tracktion::engine::EditPlaybackContext::enableNodeMemorySharing ( bool  )
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.

◆ enableAudioWorkgroup()

static void tracktion::engine::EditPlaybackContext::enableAudioWorkgroup ( bool  )
static

Enables using AudioWorkgroups.

Currently experimental and only on macOS.

◆ getNumActivelyRecordingDevices()

int tracktion::engine::EditPlaybackContext::getNumActivelyRecordingDevices ( ) const

◆ incrementNumActivelyRecordingDevices()

void tracktion::engine::EditPlaybackContext::incrementNumActivelyRecordingDevices ( )

◆ decrementNumActivelyRecordingDevices()

void tracktion::engine::EditPlaybackContext::decrementNumActivelyRecordingDevices ( )

Member Data Documentation

◆ edit

Edit& tracktion::engine::EditPlaybackContext::edit

◆ transport

TransportControl& tracktion::engine::EditPlaybackContext::transport

◆ masterLevels

LevelMeasurer tracktion::engine::EditPlaybackContext::masterLevels

◆ midiDispatcher

MidiNoteDispatcher tracktion::engine::EditPlaybackContext::midiDispatcher

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