Describes the time at the start of the current audio callback. More...
#include <juce_AudioPlayHead.h>

Public Member Functions | |
| Optional< int64_t > | getBarCount () const |
| The number of bars since the beginning of the timeline. | |
| Optional< double > | getBpm () const |
| Returns the bpm, if available. | |
| Optional< double > | getEditOriginTime () const |
| For timecode, the position of the start of the timeline, in seconds from 00:00:00:00. | |
| Optional< FrameRate > | getFrameRate () const |
| The video frame rate, if available. | |
| Optional< uint64_t > | getHostTimeNs () const |
| Get the host's callback time in nanoseconds, if available. | |
| bool | getIsLooping () const |
| True if the transport is currently looping. | |
| bool | getIsPlaying () const |
| True if the transport is currently playing. | |
| bool | getIsRecording () const |
| True if the transport is currently recording. | |
| Optional< LoopPoints > | getLoopPoints () const |
| Returns host loop points, if available. | |
| Optional< double > | getPpqPosition () const |
| The current play position, in units of quarter-notes. | |
| Optional< double > | getPpqPositionOfLastBarStart () const |
| The position of the start of the last bar, in units of quarter-notes. | |
| Optional< int64_t > | getTimeInSamples () const |
| Returns the number of samples that have elapsed. | |
| Optional< double > | getTimeInSeconds () const |
| Returns the number of seconds that have elapsed. | |
| Optional< TimeSignature > | getTimeSignature () const |
| Returns the time signature, if available. | |
| bool | operator!= (const PositionInfo &other) const noexcept |
| bool | operator== (const PositionInfo &other) const noexcept |
| void | setBarCount (Optional< int64_t > barCountIn) |
| void | setBpm (Optional< double > bpmIn) |
| void | setEditOriginTime (Optional< double > editOriginTimeIn) |
| void | setFrameRate (Optional< FrameRate > frameRateIn) |
| void | setHostTimeNs (Optional< uint64_t > hostTimeNsIn) |
| void | setIsLooping (bool isLoopingIn) |
| void | setIsPlaying (bool isPlayingIn) |
| void | setIsRecording (bool isRecordingIn) |
| void | setLoopPoints (Optional< LoopPoints > loopPointsIn) |
| void | setPpqPosition (Optional< double > ppqPositionIn) |
| void | setPpqPositionOfLastBarStart (Optional< double > positionIn) |
| void | setTimeInSamples (Optional< int64_t > timeInSamplesIn) |
| void | setTimeInSeconds (Optional< double > timeInSecondsIn) |
| void | setTimeSignature (Optional< TimeSignature > timeSignatureIn) |
Private Types | |
| enum | { flagTimeSignature = 1 << 0 , flagLoopPoints = 1 << 1 , flagFrameRate = 1 << 2 , flagTimeSeconds = 1 << 3 , flagLastBarStartPpq = 1 << 4 , flagPpqPosition = 1 << 5 , flagOriginTime = 1 << 6 , flagTempo = 1 << 7 , flagTimeSamples = 1 << 8 , flagBarCount = 1 << 9 , flagHostTimeNs = 1 << 10 , flagIsPlaying = 1 << 11 , flagIsRecording = 1 << 12 , flagIsLooping = 1 << 13 } |
Private Member Functions | |
| bool | getFlag (int64_t flagToCheck) const |
| template<typename Value > | |
| Optional< Value > | getOptional (int64_t flagToCheck, Value value) const |
| void | setFlag (int64_t flagToCheck, bool value) |
| template<typename Value > | |
| void | setOptional (int64_t flagToCheck, Value &value, Optional< Value > opt) |
Private Attributes | |
| int64_t | barCount = 0 |
| int64_t | flags = 0 |
| FrameRate | frame = FrameRateType::fps23976 |
| uint64_t | hostTimeNs = 0 |
| double | lastBarStartPpq = 0.0 |
| LoopPoints | loopPoints |
| double | originTime = 0.0 |
| double | positionPpq = 0.0 |
| double | tempoBpm = 0.0 |
| int64_t | timeInSamples = 0 |
| double | timeInSeconds = 0.0 |
| TimeSignature | timeSignature |
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.
|
private |
|
inline |
The number of bars since the beginning of the timeline.
This value isn't available in all hosts or in all plugin formats.
|
inline |
Returns the bpm, if available.
|
inline |
For timecode, the position of the start of the timeline, in seconds from 00:00:00:00.
|
inlineprivate |
The video frame rate, if available.
Get the host's callback time in nanoseconds, if available.
|
inline |
True if the transport is currently looping.
|
inline |
True if the transport is currently playing.
|
inline |
True if the transport is currently recording.
(When isRecording is true, then isPlaying will also be true).
|
inline |
Returns host loop points, if available.
|
inlineprivate |
References juce::makeOptional(), and juce::nullopt.
|
inline |
The current play position, in units of quarter-notes.
|
inline |
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.
|
inline |
Returns the number of samples that have elapsed.
|
inline |
Returns the number of seconds that have elapsed.
|
inline |
Returns the time signature, if available.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
References juce::Optional< Value >::hasValue().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |