Loading...
Searching...
No Matches
juce::AudioPlayHead Class Referenceabstract

`#include <juce_AudioPlayHead.h>`

## Classes

class | FrameRate
struct | TimeSignature
struct | LoopPoints
struct | CurrentPositionInfo
class | PositionInfo

## Public Types

enum | FrameRateType { fps23976 = 0 , fps24 = 1 , fps25 = 2 , fps2997 = 3 , fps30 = 4 , fps2997drop = 5 , fps30drop = 6 , fps60 = 7 , fps60drop = 8 , fpsUnknown = 99 }

## Public Member Functions

bool | getCurrentPosition (CurrentPositionInfo &result)
virtual Optional< PositionInfo > | getPosition () const =0
virtual bool | canControlTransport ()
virtual void | transportPlay (bool shouldStartPlaying)
virtual void | transportRecord (bool shouldStartRecording)
virtual void | transportRewind ()

## Detailed Description

A subclass of AudioPlayHead can supply information about the position and status of a moving play head during audio playback.

One of these can be supplied to an AudioProcessor object so that it can find out about the position of the audio that it is rendering.

See also
  AudioProcessor::setPlayHead, AudioProcessor::getPlayHead

Definition at line 38 of file juce_AudioPlayHead.h.

## Member Enumeration Documentation

## FrameRateType

enum juce::AudioPlayHead::FrameRateType

Frame rate types.

Definition at line 49 of file juce_AudioPlayHead.h.

## Member Function Documentation

## canControlTransport()

bool juce::AudioPlayHead::canControlTransport | ( |  | ) |

virtual

Returns true if this object can control the transport.

Definition at line 26 of file juce_AudioPlayHead.cpp.

Referenced by getPosition().

## getCurrentPosition()

bool juce::AudioPlayHead::getCurrentPosition | ( | CurrentPositionInfo & | result | ) |

inline

Deprecated, use getPosition() instead.

Fills-in the given structure with details about the transport's position at the start of the current processing block. If this method returns false then the current play head position is not available and the given structure will be undefined.

You can ONLY call this from your processBlock() method! Calling it at other times will produce undefined behaviour, as the host may not have any context in which a time would make sense, and some hosts will almost certainly have multithreading issues if it's not called on the audio thread.

Definition at line 516 of file juce_AudioPlayHead.h.

## getPosition()

virtual Optional< PositionInfo > juce::AudioPlayHead::getPosition | ( |  | ) | const

pure virtual

Fetches details about the transport's position at the start of the current processing block. If this method returns nullopt then the current play head position is not available.

A non-null return value just indicates that the host was able to provide some* relevant timing information. Individual PositionInfo getters may still return nullopt.

You can ONLY call this from your processBlock() method! Calling it at other times will produce undefined behaviour, as the host may not have any context in which a time would make sense, and some hosts will almost certainly have multithreading issues if it's not called on the audio thread.

Referenced by getCurrentPosition().

## transportPlay()

void juce::AudioPlayHead::transportPlay | ( | bool | shouldStartPlaying | ) |

virtual

Starts or stops the audio.

Definition at line 27 of file juce_AudioPlayHead.cpp.

Referenced by getPosition().

## transportRecord()

void juce::AudioPlayHead::transportRecord | ( | bool | shouldStartRecording | ) |

virtual

Starts or stops recording the audio.

Definition at line 28 of file juce_AudioPlayHead.cpp.

Referenced by getPosition().

## transportRewind()

void juce::AudioPlayHead::transportRewind | ( |  | ) |

virtual

Rewinds the audio.

Definition at line 29 of file juce_AudioPlayHead.cpp.

Referenced by getPosition().

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

- juce_AudioPlayHead.h
- juce_AudioPlayHead.cpp