Describes the time at the start of the current audio callback.
Not all hosts and plugin formats can provide all of the possible time information, so most of the getter functions in this class return an Optional that will only be engaged if the host provides the corresponding information. As a plugin developer, you should code defensively so that the plugin behaves sensibly even when the host fails to provide timing information.
A default-constructed instance of this class will return nullopt from all functions that return an Optional.
Public Member Functions | |
Optional< int64_t > | getTimeInSamples () const |
Returns the number of samples that have elapsed. | |
void | setTimeInSamples (Optional< int64_t > timeInSamplesIn) |
Optional< double > | getTimeInSeconds () const |
Returns the number of seconds that have elapsed. | |
void | setTimeInSeconds (Optional< double > timeInSecondsIn) |
Optional< double > | getBpm () const |
Returns the bpm, if available. | |
void | setBpm (Optional< double > bpmIn) |
Optional< TimeSignature > | getTimeSignature () const |
Returns the time signature, if available. | |
void | setTimeSignature (Optional< TimeSignature > timeSignatureIn) |
Optional< LoopPoints > | getLoopPoints () const |
Returns host loop points, if available. | |
void | setLoopPoints (Optional< LoopPoints > loopPointsIn) |
Optional< int64_t > | getBarCount () const |
The number of bars since the beginning of the timeline. | |
void | setBarCount (Optional< int64_t > barCountIn) |
Optional< double > | getPpqPositionOfLastBarStart () const |
The position of the start of the last bar, in units of quarter-notes. | |
void | setPpqPositionOfLastBarStart (Optional< double > positionIn) |
Optional< FrameRate > | getFrameRate () const |
The video frame rate, if available. | |
void | setFrameRate (Optional< FrameRate > frameRateIn) |
Optional< double > | getPpqPosition () const |
The current play position, in units of quarter-notes. | |
void | setPpqPosition (Optional< double > ppqPositionIn) |
Optional< double > | getEditOriginTime () const |
For timecode, the position of the start of the timeline, in seconds from 00:00:00:00. | |
void | setEditOriginTime (Optional< double > editOriginTimeIn) |
Optional< uint64_t > | getHostTimeNs () const |
Get the host's callback time in nanoseconds, if available. | |
void | setHostTimeNs (Optional< uint64_t > hostTimeNsIn) |
bool | getIsPlaying () const |
True if the transport is currently playing. | |
void | setIsPlaying (bool isPlayingIn) |
bool | getIsRecording () const |
True if the transport is currently recording. | |
void | setIsRecording (bool isRecordingIn) |
bool | getIsLooping () const |
True if the transport is currently looping. | |
void | setIsLooping (bool isLoopingIn) |
bool | operator== (const PositionInfo &other) const noexcept |
bool | operator!= (const PositionInfo &other) const noexcept |
Optional< int64_t > juce::AudioPlayHead::PositionInfo::getTimeInSamples | ( | ) | const |
Returns the number of samples that have elapsed.
void juce::AudioPlayHead::PositionInfo::setTimeInSamples | ( | Optional< int64_t > | timeInSamplesIn | ) |
Optional< double > juce::AudioPlayHead::PositionInfo::getTimeInSeconds | ( | ) | const |
Returns the number of seconds that have elapsed.
void juce::AudioPlayHead::PositionInfo::setTimeInSeconds | ( | Optional< double > | timeInSecondsIn | ) |
Optional< double > juce::AudioPlayHead::PositionInfo::getBpm | ( | ) | const |
Returns the bpm, if available.
Optional< TimeSignature > juce::AudioPlayHead::PositionInfo::getTimeSignature | ( | ) | const |
Returns the time signature, if available.
void juce::AudioPlayHead::PositionInfo::setTimeSignature | ( | Optional< TimeSignature > | timeSignatureIn | ) |
Optional< LoopPoints > juce::AudioPlayHead::PositionInfo::getLoopPoints | ( | ) | const |
Returns host loop points, if available.
void juce::AudioPlayHead::PositionInfo::setLoopPoints | ( | Optional< LoopPoints > | loopPointsIn | ) |
Optional< int64_t > juce::AudioPlayHead::PositionInfo::getBarCount | ( | ) | const |
The number of bars since the beginning of the timeline.
This value isn't available in all hosts or in all plugin formats.
void juce::AudioPlayHead::PositionInfo::setBarCount | ( | Optional< int64_t > | barCountIn | ) |
Optional< double > juce::AudioPlayHead::PositionInfo::getPpqPositionOfLastBarStart | ( | ) | const |
The position of the start of the last bar, in units of quarter-notes.
This is the time from the start of the timeline to the start of the current bar, in ppq units.
Note - this value may be unavailable on some hosts, e.g. Pro-Tools.
void juce::AudioPlayHead::PositionInfo::setPpqPositionOfLastBarStart | ( | Optional< double > | positionIn | ) |
The video frame rate, if available.
Optional< double > juce::AudioPlayHead::PositionInfo::getPpqPosition | ( | ) | const |
The current play position, in units of quarter-notes.
void juce::AudioPlayHead::PositionInfo::setPpqPosition | ( | Optional< double > | ppqPositionIn | ) |
Optional< double > juce::AudioPlayHead::PositionInfo::getEditOriginTime | ( | ) | const |
For timecode, the position of the start of the timeline, in seconds from 00:00:00:00.
void juce::AudioPlayHead::PositionInfo::setEditOriginTime | ( | Optional< double > | editOriginTimeIn | ) |
Optional< uint64_t > juce::AudioPlayHead::PositionInfo::getHostTimeNs | ( | ) | const |
Get the host's callback time in nanoseconds, if available.
void juce::AudioPlayHead::PositionInfo::setHostTimeNs | ( | Optional< uint64_t > | hostTimeNsIn | ) |
bool juce::AudioPlayHead::PositionInfo::getIsPlaying | ( | ) | const |
True if the transport is currently playing.
void juce::AudioPlayHead::PositionInfo::setIsPlaying | ( | bool | isPlayingIn | ) |
bool juce::AudioPlayHead::PositionInfo::getIsRecording | ( | ) | const |
True if the transport is currently recording.
(When isRecording is true, then isPlaying will also be true).
void juce::AudioPlayHead::PositionInfo::setIsRecording | ( | bool | isRecordingIn | ) |
bool juce::AudioPlayHead::PositionInfo::getIsLooping | ( | ) | const |
True if the transport is currently looping.
void juce::AudioPlayHead::PositionInfo::setIsLooping | ( | bool | isLoopingIn | ) |
|
noexcept |
|
noexcept |