Loading...
Searching...
No Matches
AudioPlayHead::PositionInfo Class Reference

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< TimeSignaturegetTimeSignature () const
 Returns the time signature, if available.
 
void setTimeSignature (Optional< TimeSignature > timeSignatureIn)
 
Optional< LoopPointsgetLoopPoints () 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< FrameRategetFrameRate () 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
 

Detailed Description

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.

Member Function Documentation

◆ getTimeInSamples()

Optional< int64_t > AudioPlayHead::PositionInfo::getTimeInSamples ( ) const

Returns the number of samples that have elapsed.

◆ setTimeInSamples()

void AudioPlayHead::PositionInfo::setTimeInSamples ( Optional< int64_t > timeInSamplesIn)

◆ getTimeInSeconds()

Optional< double > AudioPlayHead::PositionInfo::getTimeInSeconds ( ) const

Returns the number of seconds that have elapsed.

◆ setTimeInSeconds()

void AudioPlayHead::PositionInfo::setTimeInSeconds ( Optional< double > timeInSecondsIn)

◆ getBpm()

Optional< double > AudioPlayHead::PositionInfo::getBpm ( ) const

Returns the bpm, if available.

◆ setBpm()

void AudioPlayHead::PositionInfo::setBpm ( Optional< double > bpmIn)
See also
getBpm()

◆ getTimeSignature()

Optional< TimeSignature > AudioPlayHead::PositionInfo::getTimeSignature ( ) const

Returns the time signature, if available.

◆ setTimeSignature()

void AudioPlayHead::PositionInfo::setTimeSignature ( Optional< TimeSignature > timeSignatureIn)

◆ getLoopPoints()

Optional< LoopPoints > AudioPlayHead::PositionInfo::getLoopPoints ( ) const

Returns host loop points, if available.

◆ setLoopPoints()

void AudioPlayHead::PositionInfo::setLoopPoints ( Optional< LoopPoints > loopPointsIn)
See also
getLoopPoints()

◆ getBarCount()

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.

◆ setBarCount()

void AudioPlayHead::PositionInfo::setBarCount ( Optional< int64_t > barCountIn)
See also
getBarCount()

◆ getPpqPositionOfLastBarStart()

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.

◆ setPpqPositionOfLastBarStart()

void AudioPlayHead::PositionInfo::setPpqPositionOfLastBarStart ( Optional< double > positionIn)

◆ getFrameRate()

Optional< FrameRate > AudioPlayHead::PositionInfo::getFrameRate ( ) const

The video frame rate, if available.

◆ setFrameRate()

void AudioPlayHead::PositionInfo::setFrameRate ( Optional< FrameRate > frameRateIn)
See also
getFrameRate()

◆ getPpqPosition()

Optional< double > AudioPlayHead::PositionInfo::getPpqPosition ( ) const

The current play position, in units of quarter-notes.

◆ setPpqPosition()

void AudioPlayHead::PositionInfo::setPpqPosition ( Optional< double > ppqPositionIn)

◆ getEditOriginTime()

Optional< double > AudioPlayHead::PositionInfo::getEditOriginTime ( ) const

For timecode, the position of the start of the timeline, in seconds from 00:00:00:00.

◆ setEditOriginTime()

void AudioPlayHead::PositionInfo::setEditOriginTime ( Optional< double > editOriginTimeIn)

◆ getHostTimeNs()

Optional< uint64_t > AudioPlayHead::PositionInfo::getHostTimeNs ( ) const

Get the host's callback time in nanoseconds, if available.

◆ setHostTimeNs()

void AudioPlayHead::PositionInfo::setHostTimeNs ( Optional< uint64_t > hostTimeNsIn)
See also
getHostTimeNs()

◆ getIsPlaying()

bool AudioPlayHead::PositionInfo::getIsPlaying ( ) const

True if the transport is currently playing.

◆ setIsPlaying()

void AudioPlayHead::PositionInfo::setIsPlaying ( bool isPlayingIn)
See also
getIsPlaying()

◆ getIsRecording()

bool AudioPlayHead::PositionInfo::getIsRecording ( ) const

True if the transport is currently recording.

(When isRecording is true, then isPlaying will also be true).

◆ setIsRecording()

void AudioPlayHead::PositionInfo::setIsRecording ( bool isRecordingIn)

◆ getIsLooping()

bool AudioPlayHead::PositionInfo::getIsLooping ( ) const

True if the transport is currently looping.

◆ setIsLooping()

void AudioPlayHead::PositionInfo::setIsLooping ( bool isLoopingIn)
See also
getIsLooping()

◆ operator==()

bool AudioPlayHead::PositionInfo::operator== ( const PositionInfo & other) const
noexcept

◆ operator!=()

bool AudioPlayHead::PositionInfo::operator!= ( const PositionInfo & other) const
noexcept

References operator==().


The documentation for this class was generated from the following file:
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram