TracktionEngine
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tracktion::engine::EditPlaybackContext Class Reference

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. More...
 
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. More...
 
void prepareForPlaying (TimePosition startTime)
 
void prepareForRecording (TimePosition startTime, TimePosition punchIn)
 
void syncToContext (EditPlaybackContext *contextToSyncTo, TimePosition previousBarTime, TimeDuration syncInterval)
 
Clip::Array stopRecording (InputDeviceInstance &, TimeRange recordedRange, bool discardRecordings)
 
Clip::Array recordingFinished (TimeRange recordedRange, bool discardRecordings)
 
juce::Result applyRetrospectiveRecord (juce::Array< Clip * > *clipsCreated=nullptr)
 
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. More...
 
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. More...
 
void setTempoAdjustment (double plusOrMinusProportion)
 This will increase/decrease playback speed by changing the tempo, maintaining pitch where possible. More...
 
void postPosition (TimePosition positionToJumpTo, std::optional< TimePosition > whenToJump={})
 Posts a transport position change. More...
 
std::optional< TimePosition > getPendingPositionChange () const
 Returns a pending position change if there is one. More...
 
void play ()
 
void stop ()
 
TimePosition globalStreamTimeToEditTime (double) const
 
TimePosition globalStreamTimeToEditTimeUnlooped (double) const
 
void resyncToGlobalStreamTime (juce::Range< double >, double sampleRate)
 
tracktion::graph::PlayHeadgetNodePlayHead () const
 

Static Public Member Functions

static bool shouldAddAntiDenormalisationNoise (Engine &)
 
static void setAddAntiDenormalisationNoise (Engine &, bool)
 
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. More...
 

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()

Clip::Array tracktion::engine::EditPlaybackContext::stopRecording ( InputDeviceInstance ,
TimeRange  recordedRange,
bool  discardRecordings 
)

◆ recordingFinished()

Clip::Array tracktion::engine::EditPlaybackContext::recordingFinished ( TimeRange  recordedRange,
bool  discardRecordings 
)

◆ applyRetrospectiveRecord()

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

◆ getAllInputs()

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

◆ getInputFor()

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

◆ getOutputFor()

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

◆ shouldAddAntiDenormalisationNoise()

static bool tracktion::engine::EditPlaybackContext::shouldAddAntiDenormalisationNoise ( Engine )
static

◆ setAddAntiDenormalisationNoise()

static void tracktion::engine::EditPlaybackContext::setAddAntiDenormalisationNoise ( Engine ,
bool   
)
static

◆ 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 ( )

◆ 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.

◆ 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.

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: