TracktionEngine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
engine::AudioClipPlayhead Struct Reference

Holds a playhead for an AudioClipBase. More...

#include <tracktion_AudioClipBase.h>

Public Member Functions

std::optional< TimePosition > getPosition (uint32_t maxAgeMs=50) const
 Returns the last played position relative to the clip's source if it has been updated within the staleness window (default 100ms).
 
void setPosition (std::optional< TimePosition > p)
 Sets the current played position and stamps it with the current time.
 

Detailed Description

Holds a playhead for an AudioClipBase.

This is automatically updated by the playback graph so the UI should only read from it. The position is the time relative to the clip's source file (i.e. from the offset to the clip end, wrapped within the loop section when looping). [[ thread_safe ]]

Member Function Documentation

◆ getPosition()

std::optional< TimePosition > engine::AudioClipPlayhead::getPosition ( uint32_t  maxAgeMs = 50) const

Returns the last played position relative to the clip's source if it has been updated within the staleness window (default 100ms).

If no position has been written recently, returns std::nullopt so the UI can hide the playhead when the clip stops playing.

◆ setPosition()

void engine::AudioClipPlayhead::setPosition ( std::optional< TimePosition >  p)

Sets the current played position and stamps it with the current time.

This is called from the playback graph and shouldn't be called by user code.


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