OpenShot Audio Library | OpenShotAudio: juce::PositionableAudioSource Class Reference

OpenShot Audio Library | OpenShotAudio 0.4.0 |

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
juce::PositionableAudioSource Class Referenceabstract

`#include <juce_PositionableAudioSource.h>`

Inheritance diagram for juce::PositionableAudioSource:

## Public Member Functions
| ~PositionableAudioSource () override=default
virtual void | setNextReadPosition (int64 newPosition)=0
virtual int64 | getNextReadPosition () const =0
virtual int64 | getTotalLength () const =0
virtual bool | isLooping () const =0
virtual void | setLooping (bool shouldLoop)
Public Member Functions inherited from juce::AudioSource
virtual | ~AudioSource ()=default
virtual void | prepareToPlay (int samplesPerBlockExpected, double sampleRate)=0
virtual void | releaseResources ()=0
virtual void | getNextAudioBlock (const AudioSourceChannelInfo &bufferToFill)=0

## Protected Member Functions
| PositionableAudioSource ()=default
Protected Member Functions inherited from juce::AudioSource
| AudioSource ()=default

## Detailed Description

A type of AudioSource which can be repositioned.

The basic AudioSource just streams continuously with no idea of a current time or length, so the PositionableAudioSource is used for a finite stream that has a current read position.

See also
  AudioSource, AudioTransportSource

Definition at line 38 of file juce_PositionableAudioSource.h.

## Constructor & Destructor Documentation

## ◆ PositionableAudioSource()

juce::PositionableAudioSource::PositionableAudioSource | ( |  | ) |
| protecteddefault

Creates the PositionableAudioSource.

Referenced by juce::BufferingAudioSource::BufferingAudioSource(), and juce::AudioTransportSource::setSource().

## ◆ ~PositionableAudioSource()

juce::PositionableAudioSource::~PositionableAudioSource | ( |  | ) |
| overridedefault

Destructor

## Member Function Documentation

## ◆ getNextReadPosition()

virtual int64 juce::PositionableAudioSource::getNextReadPosition | ( |  | ) | const
| pure virtual

Returns the position from which the next block will be returned.

See also
  setNextReadPosition

Implemented in juce::AudioFormatReaderSource, juce::AudioTransportSource, juce::BufferingAudioSource, and juce::MemoryAudioSource.

## ◆ getTotalLength()

virtual int64 juce::PositionableAudioSource::getTotalLength | ( |  | ) | const
| pure virtual

Returns the total length of the stream (in samples).

Implemented in juce::AudioFormatReaderSource, juce::AudioTransportSource, juce::BufferingAudioSource, and juce::MemoryAudioSource.

## ◆ isLooping()

virtual bool juce::PositionableAudioSource::isLooping | ( |  | ) | const
| pure virtual

Returns true if this source is actually playing in a loop.

Implemented in juce::AudioFormatReaderSource, juce::AudioTransportSource, juce::BufferingAudioSource, and juce::MemoryAudioSource.

## ◆ setLooping()

void juce::PositionableAudioSource::setLooping | ( | bool | shouldLoop | ) |
| virtual

Tells the source whether you'd like it to play in a loop.

Reimplemented in juce::AudioFormatReaderSource, and juce::MemoryAudioSource.

Definition at line 26 of file juce_PositionableAudioSource.cpp.

Referenced by isLooping().

## ◆ setNextReadPosition()

virtual void juce::PositionableAudioSource::setNextReadPosition | ( | int64 | newPosition | ) |
| pure virtual

Tells the stream to move to a new position.

Calling this indicates that the next call to AudioSource::getNextAudioBlock() should return samples from this position.

Note that this may be called on a different thread to getNextAudioBlock(), so the subclass should make sure it's synchronised.

Implemented in juce::AudioFormatReaderSource, juce::AudioTransportSource, juce::BufferingAudioSource, and juce::MemoryAudioSource.

Referenced by juce::AudioTransportSource::setSource().

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

- juce_PositionableAudioSource.h
- juce_PositionableAudioSource.cpp