TracktionEngine
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
engine::LaunchHandle Class Reference

A handle used to control the launching of a clip. More...

#include <tracktion_LaunchHandle.h>

Classes

struct  SplitStatus
 Represents two beat ranges where the play state can be different in each. More...
 

Public Types

enum class  PlayState : char { stopped , playing }
 
enum class  QueueState : char { stopQueued , playQueued }
 

Public Member Functions

 LaunchHandle ()=default
 Creates a LaunchHandle.
 
 LaunchHandle (const LaunchHandle &)
 Creates a copy of another LaunchHandle.
 
PlayState getPlayingStatus () const
 Returns the current playback state.
 
std::optional< QueueStategetQueuedStatus () const
 Returns the current queue state.
 
std::optional< MonotonicBeat > getQueuedEventPosition () const
 Returns the current queued event time.
 
void play (std::optional< MonotonicBeat >)
 Start playing, optionally at a given beat position.
 
void stop (std::optional< MonotonicBeat >)
 Stop playing, optionally at a given beat position.
 
void playSynced (const LaunchHandle &, std::optional< MonotonicBeat >)
 Starts playing, as if it was started at the same time as the given LaunchHandle.
 
void setLooping (std::optional< BeatDuration >)
 Sets a duration to loop.
 
void nudge (BeatDuration)
 Moves the playhead by a given number of beats.
 
SplitStatus advance (const SyncRange &)
 Advance the state.
 
std::optional< BeatRange > getPlayedRange () const
 Returns the Edit beat range this has been playing for.
 
std::optional< MonotonicBeatRange > getPlayedMonotonicRange () const
 Returns the monotonic beat range this has been playing for.
 
std::optional< BeatRange > getLastPlayedRange () const
 

Detailed Description

A handle used to control the launching of a clip.

This doesn't directly map on to playback beat positions of the clip, it just handles the start/stop status in relation to the Edit timeline. Once this has been retrieved by calling update, this needs to be wrapped in to playback actions.

Member Enumeration Documentation

◆ PlayState

enum class engine::LaunchHandle::PlayState : char
strong
Enumerator
stopped 
playing 

◆ QueueState

enum class engine::LaunchHandle::QueueState : char
strong
Enumerator
stopQueued 
playQueued 

Constructor & Destructor Documentation

◆ LaunchHandle() [1/2]

engine::LaunchHandle::LaunchHandle ( )
default

Creates a LaunchHandle.

◆ LaunchHandle() [2/2]

engine::LaunchHandle::LaunchHandle ( const LaunchHandle )

Creates a copy of another LaunchHandle.

Member Function Documentation

◆ getPlayingStatus()

PlayState engine::LaunchHandle::getPlayingStatus ( ) const

Returns the current playback state.

◆ getQueuedStatus()

std::optional< QueueState > engine::LaunchHandle::getQueuedStatus ( ) const

Returns the current queue state.

◆ getQueuedEventPosition()

std::optional< MonotonicBeat > engine::LaunchHandle::getQueuedEventPosition ( ) const

Returns the current queued event time.

◆ play()

void engine::LaunchHandle::play ( std::optional< MonotonicBeat >  )

Start playing, optionally at a given beat position.

◆ stop()

void engine::LaunchHandle::stop ( std::optional< MonotonicBeat >  )

Stop playing, optionally at a given beat position.

◆ playSynced()

void engine::LaunchHandle::playSynced ( const LaunchHandle ,
std::optional< MonotonicBeat >   
)

Starts playing, as if it was started at the same time as the given LaunchHandle.

This can optionally be delayed by supplying a MonotonicBeat to start at.

◆ setLooping()

void engine::LaunchHandle::setLooping ( std::optional< BeatDuration >  )

Sets a duration to loop.

If enabled, this will loop the handle's play duration as if it was re-triggered every duration. Set the nullopt to cancel looping.

◆ nudge()

void engine::LaunchHandle::nudge ( BeatDuration  )

Moves the playhead by a given number of beats.

◆ advance()

SplitStatus engine::LaunchHandle::advance ( const SyncRange &  )

Advance the state.

N.B. This should only be called by the audio thread.

Parameters
SyncRangeThe current SyncRange. Used to sync launch positions to
Returns
The unlooped Edit beat range split if there are different play/stop states. [[ audio_thread ]]

◆ getPlayedRange()

std::optional< BeatRange > engine::LaunchHandle::getPlayedRange ( ) const

Returns the Edit beat range this has been playing for.

N.B. The length is unlooped and so monotonically increasing.

◆ getPlayedMonotonicRange()

std::optional< MonotonicBeatRange > engine::LaunchHandle::getPlayedMonotonicRange ( ) const

Returns the monotonic beat range this has been playing for.

N.B. This is really only useful for syncing to other timeline events.

◆ getLastPlayedRange()

std::optional< BeatRange > engine::LaunchHandle::getLastPlayedRange ( ) const

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