Describes the time at the start of the current audio callback. More...
#include <juce_AudioPlayHead.h>
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 |
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.
Optional< int64_t > AudioPlayHead::PositionInfo::getTimeInSamples | ( | ) | const |
Returns the number of samples that have elapsed.
void AudioPlayHead::PositionInfo::setTimeInSamples | ( | Optional< int64_t > | timeInSamplesIn | ) |
Optional< double > AudioPlayHead::PositionInfo::getTimeInSeconds | ( | ) | const |
Returns the number of seconds that have elapsed.
void AudioPlayHead::PositionInfo::setTimeInSeconds | ( | Optional< double > | timeInSecondsIn | ) |
Optional< double > AudioPlayHead::PositionInfo::getBpm | ( | ) | const |
Returns the bpm, if available.
Optional< TimeSignature > AudioPlayHead::PositionInfo::getTimeSignature | ( | ) | const |
Returns the time signature, if available.
void AudioPlayHead::PositionInfo::setTimeSignature | ( | Optional< TimeSignature > | timeSignatureIn | ) |
Optional< LoopPoints > AudioPlayHead::PositionInfo::getLoopPoints | ( | ) | const |
Returns host loop points, if available.
void AudioPlayHead::PositionInfo::setLoopPoints | ( | Optional< LoopPoints > | loopPointsIn | ) |
Optional< int64_t > 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 AudioPlayHead::PositionInfo::setBarCount | ( | Optional< int64_t > | barCountIn | ) |
Optional< double > 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 AudioPlayHead::PositionInfo::setPpqPositionOfLastBarStart | ( | Optional< double > | positionIn | ) |
The video frame rate, if available.
Optional< double > AudioPlayHead::PositionInfo::getPpqPosition | ( | ) | const |
The current play position, in units of quarter-notes.
void AudioPlayHead::PositionInfo::setPpqPosition | ( | Optional< double > | ppqPositionIn | ) |
Optional< double > AudioPlayHead::PositionInfo::getEditOriginTime | ( | ) | const |
For timecode, the position of the start of the timeline, in seconds from 00:00:00:00.
void AudioPlayHead::PositionInfo::setEditOriginTime | ( | Optional< double > | editOriginTimeIn | ) |
Optional< uint64_t > AudioPlayHead::PositionInfo::getHostTimeNs | ( | ) | const |
Get the host's callback time in nanoseconds, if available.
void AudioPlayHead::PositionInfo::setHostTimeNs | ( | Optional< uint64_t > | hostTimeNsIn | ) |
bool AudioPlayHead::PositionInfo::getIsPlaying | ( | ) | const |
True if the transport is currently playing.
void AudioPlayHead::PositionInfo::setIsPlaying | ( | bool | isPlayingIn | ) |
bool AudioPlayHead::PositionInfo::getIsRecording | ( | ) | const |
True if the transport is currently recording.
(When isRecording is true, then isPlaying will also be true).
void AudioPlayHead::PositionInfo::setIsRecording | ( | bool | isRecordingIn | ) |
bool AudioPlayHead::PositionInfo::getIsLooping | ( | ) | const |
True if the transport is currently looping.
void AudioPlayHead::PositionInfo::setIsLooping | ( | bool | isLoopingIn | ) |
|
noexcept |
|
noexcept |
References operator==().