JUCE: AudioPlayHead Class Reference

JUCE

Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
AudioPlayHead Class Referenceabstract
juce_audio_basics » audio_play_head

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

`#include <juce_AudioPlayHead.h>`

## Classes
struct | CurrentPositionInfo
| This structure is filled-in by the AudioPlayHead::getCurrentPosition() method. More...
class | FrameRate
| More descriptive frame rate type. More...

## Public Types
enum | FrameRateType { fps23976 = 0 , fps24 = 1 , fps25 = 2 , fps2997 = 3 , fps30 = 4 , fps2997drop = 5 , fps30drop = 6 , fps60 = 7 , fps60drop = 8 , fpsUnknown = 99 }
| Frame rate types. More...

## Public Member Functions
virtual | ~AudioPlayHead ()=default
virtual bool | getCurrentPosition (CurrentPositionInfo &result)=0
| Fills-in the given structure with details about the transport's position at the start of the current processing block. More...
virtual bool | canControlTransport ()
| Returns true if this object can control the transport. More...
virtual void | transportPlay (bool shouldStartPlaying)
| Starts or stops the audio. More...
virtual void | transportRecord (bool shouldStartRecording)
| Starts or stops recording the audio. More...
virtual void | transportRewind ()
| Rewinds the audio. More...

## Protected Member Functions
| AudioPlayHead ()=default

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

## Member Enumeration Documentation

## ◆ FrameRateType

enum AudioPlayHead::FrameRateType

Frame rate types.

Enumerator
fps23976 |
fps24 |
fps25 |
fps2997 |
fps30 |
fps2997drop |
fps30drop |
fps60 |
fps60drop |
fpsUnknown |

## Constructor & Destructor Documentation

## ◆ AudioPlayHead()

AudioPlayHead::AudioPlayHead | ( |  | ) |
| protecteddefault

## ◆ ~AudioPlayHead()

virtual AudioPlayHead::~AudioPlayHead | ( |  | ) |
| virtualdefault

## Member Function Documentation

## ◆ getCurrentPosition()

virtual bool AudioPlayHead::getCurrentPosition | ( | CurrentPositionInfo & | result | ) |
| pure virtual

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.

## ◆ canControlTransport()

virtual bool AudioPlayHead::canControlTransport | ( |  | ) |
| virtual

Returns true if this object can control the transport.

## ◆ transportPlay()

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

Starts or stops the audio.

References ignoreUnused().

## ◆ transportRecord()

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

Starts or stops recording the audio.

References ignoreUnused().

## ◆ transportRewind()

virtual void AudioPlayHead::transportRewind | ( |  | ) |
| virtual

Rewinds the audio.

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

- juce_AudioPlayHead.h