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

## 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.

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

- juce_audio_basics/audio_play_head/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

## Member Functions

## getTimeInSamples()

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

inline

Returns the number of samples that have elapsed.

## setTimeInSamples()

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

inline

See also
  getTimeInSamples()

## getTimeInSeconds()

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

inline

Returns the number of seconds that have elapsed.

## setTimeInSeconds()

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

inline

See also
  getTimeInSamples()

## getBpm()

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

inline

Returns the bpm, if available.

## setBpm()

void juce::AudioPlayHead::PositionInfo::setBpm | ( | Optional< double > | bpmIn | ) |

inline

See also
  getBpm()

## getTimeSignature()

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

inline

Returns the time signature, if available.

## setTimeSignature()

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

inline

See also
  getTimeSignature()

## getLoopPoints()

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

inline

Returns host loop points, if available.

## setLoopPoints()

void juce::AudioPlayHead::PositionInfo::setLoopPoints | ( | Optional< LoopPoints > | loopPointsIn | ) |

inline

See also
  getLoopPoints()

## getBarCount()

Optional< int64_t > juce::AudioPlayHead::PositionInfo::getBarCount | ( |  | ) | const

inline

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 juce::AudioPlayHead::PositionInfo::setBarCount | ( | Optional< int64_t > | barCountIn | ) |

inline

See also
  getBarCount()

## getPpqPositionOfLastBarStart()

Optional< double > juce::AudioPlayHead::PositionInfo::getPpqPositionOfLastBarStart | ( |  | ) | const

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.

## setPpqPositionOfLastBarStart()

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

inline

See also
  getPpqPositionOfLastBarStart()

## getFrameRate()

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

inline

The video frame rate, if available.

## setFrameRate()

void juce::AudioPlayHead::PositionInfo::setFrameRate | ( | Optional< FrameRate > | frameRateIn | ) |

inline

See also
  getFrameRate()

## getPpqPosition()

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

inline

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

## setPpqPosition()

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

inline

See also
  getPpqPosition()

## getEditOriginTime()

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

inline

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

## setEditOriginTime()

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

inline

See also
  getEditOriginTime()

## getHostTimeNs()

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

inline

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

## setHostTimeNs()

void juce::AudioPlayHead::PositionInfo::setHostTimeNs | ( | Optional< uint64_t > | hostTimeNsIn | ) |

inline

See also
  getHostTimeNs()

## getIsPlaying()

bool juce::AudioPlayHead::PositionInfo::getIsPlaying | ( |  | ) | const

inline

True if the transport is currently playing.

## setIsPlaying()

void juce::AudioPlayHead::PositionInfo::setIsPlaying | ( | bool | isPlayingIn | ) |

inline

See also
  getIsPlaying()

## getIsRecording()

bool juce::AudioPlayHead::PositionInfo::getIsRecording | ( |  | ) | const

inline

True if the transport is currently recording.

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

## setIsRecording()

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

inline

See also
  getIsRecording()

## getIsLooping()

bool juce::AudioPlayHead::PositionInfo::getIsLooping | ( |  | ) | const

inline

True if the transport is currently looping.

## setIsLooping()

void juce::AudioPlayHead::PositionInfo::setIsLooping | ( | bool | isLoopingIn | ) |

inline

See also
  getIsLooping()

## operator==()

bool juce::AudioPlayHead::PositionInfo::operator== | ( | const PositionInfo & | other | ) | const

noexcept

## operator!=()

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

inline noexcept

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited