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

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

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

- juce_audio_basics/audio_play_head/juce_AudioPlayHead.h

## Classes

class | FrameRate
| More descriptive frame rate type. More...
struct | TimeSignature
| Describes a musical time signature. More...
struct | LoopPoints
| Holds the begin and end points of a looped region. More...
struct | CurrentPositionInfo
| This type is deprecated; prefer PositionInfo instead. More...
class | PositionInfo
| Describes the time at the start of the current audio callback. 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
bool | getCurrentPosition (CurrentPositionInfo &result)
| Deprecated, use getPosition() instead.
virtual Optional< PositionInfo > | getPosition () const =0
| Fetches details about the transport's position at the start of the current processing block.
virtual bool | canControlTransport ()
| Returns true if this object can control the transport.
virtual void | transportPlay (bool shouldStartPlaying)
| Starts or stops the audio.
virtual void | transportRecord (bool shouldStartRecording)
| Starts or stops recording the audio.
virtual void | transportRewind ()
| Rewinds the audio.

## Protected Member Functions

| AudioPlayHead ()=default

## Member Enums

## FrameRateType

enum juce::AudioPlayHead::FrameRateType

Frame rate types.

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

## Constructors and Destructors

## AudioPlayHead()

juce::AudioPlayHead::AudioPlayHead | ( |  | ) |

protected default

## ~AudioPlayHead()

virtual juce::AudioPlayHead::~AudioPlayHead | ( |  | ) |

virtual default

## Member Functions

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

References juce::AudioPlayHead::CurrentPositionInfo::bpm, juce::AudioPlayHead::CurrentPositionInfo::editOriginTime, juce::AudioPlayHead::CurrentPositionInfo::frameRate, getPosition(), juce::AudioPlayHead::CurrentPositionInfo::isLooping, juce::AudioPlayHead::CurrentPositionInfo::isPlaying, juce::AudioPlayHead::CurrentPositionInfo::isRecording, juce::AudioPlayHead::CurrentPositionInfo::ppqLoopEnd, juce::AudioPlayHead::CurrentPositionInfo::ppqLoopStart, juce::AudioPlayHead::CurrentPositionInfo::ppqPosition, juce::AudioPlayHead::CurrentPositionInfo::ppqPositionOfLastBarStart, juce::AudioPlayHead::CurrentPositionInfo::resetToDefault(), juce::AudioPlayHead::CurrentPositionInfo::timeInSamples, juce::AudioPlayHead::CurrentPositionInfo::timeInSeconds, juce::AudioPlayHead::CurrentPositionInfo::timeSigDenominator, and juce::AudioPlayHead::CurrentPositionInfo::timeSigNumerator.

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

## canControlTransport()

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

virtual

Returns true if this object can control the transport.

## transportPlay()

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

virtual

Starts or stops the audio.

## transportRecord()

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

virtual

Starts or stops recording the audio.

## transportRewind()

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

virtual

Rewinds the audio.

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