TracktionEngine
|
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< QueueState > | getQueuedStatus () 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 |
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.
|
strong |
|
strong |
|
default |
Creates a LaunchHandle.
engine::LaunchHandle::LaunchHandle | ( | const LaunchHandle & | ) |
Creates a copy of another LaunchHandle.
PlayState engine::LaunchHandle::getPlayingStatus | ( | ) | const |
Returns the current playback state.
std::optional< QueueState > engine::LaunchHandle::getQueuedStatus | ( | ) | const |
Returns the current queue state.
std::optional< MonotonicBeat > engine::LaunchHandle::getQueuedEventPosition | ( | ) | const |
Returns the current queued event time.
void engine::LaunchHandle::play | ( | std::optional< MonotonicBeat > | ) |
Start playing, optionally at a given beat position.
void engine::LaunchHandle::stop | ( | std::optional< MonotonicBeat > | ) |
Stop playing, optionally at a given beat position.
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.
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.
void engine::LaunchHandle::nudge | ( | BeatDuration | ) |
Moves the playhead by a given number of beats.
SplitStatus engine::LaunchHandle::advance | ( | const SyncRange & | ) |
Advance the state.
N.B. This should only be called by the audio thread.
SyncRange | The current SyncRange. Used to sync launch positions to |
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.
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.
std::optional< BeatRange > engine::LaunchHandle::getLastPlayedRange | ( | ) | const |