JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::AudioFormatReaderSource Class Reference

A type of AudioSource that will read from an AudioFormatReader. More...

#include <juce_AudioFormatReaderSource.h>

Inheritance diagram for juce::AudioFormatReaderSource:
Collaboration diagram for juce::AudioFormatReaderSource:

Public Member Functions

 AudioFormatReaderSource (AudioFormatReader *sourceReader, bool deleteReaderWhenThisIsDeleted)
 Creates an AudioFormatReaderSource for a given reader. More...
 
 ~AudioFormatReaderSource () override
 Destructor. More...
 
AudioFormatReadergetAudioFormatReader () const noexcept
 Returns the reader that's being used. More...
 
void getNextAudioBlock (const AudioSourceChannelInfo &) override
 Implementation of the AudioSource method. More...
 
int64 getNextReadPosition () const override
 Implements the PositionableAudioSource method. More...
 
int64 getTotalLength () const override
 Implements the PositionableAudioSource method. More...
 
bool isLooping () const override
 Returns whether loop-mode is turned on or not. More...
 
void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override
 Implementation of the AudioSource method. More...
 
void releaseResources () override
 Implementation of the AudioSource method. More...
 
void setLooping (bool shouldLoop) override
 Toggles loop-mode. More...
 
void setNextReadPosition (int64 newPosition) override
 Implements the PositionableAudioSource method. More...
 

Private Attributes

bool looping
 
int64 nextPlayPos
 
OptionalScopedPointer< AudioFormatReaderreader
 

Detailed Description

A type of AudioSource that will read from an AudioFormatReader.

See also
PositionableAudioSource, AudioTransportSource, BufferingAudioSource

@tags{Audio}

Constructor & Destructor Documentation

◆ AudioFormatReaderSource()

juce::AudioFormatReaderSource::AudioFormatReaderSource ( AudioFormatReader sourceReader,
bool  deleteReaderWhenThisIsDeleted 
)

Creates an AudioFormatReaderSource for a given reader.

Parameters
sourceReaderthe reader to use as the data source - this must not be null
deleteReaderWhenThisIsDeletedif true, the reader passed-in will be deleted when this object is deleted; if false it will be left up to the caller to manage its lifetime

◆ ~AudioFormatReaderSource()

juce::AudioFormatReaderSource::~AudioFormatReaderSource ( )
override

Destructor.

Member Function Documentation

◆ getAudioFormatReader()

AudioFormatReader* juce::AudioFormatReaderSource::getAudioFormatReader ( ) const
inlinenoexcept

Returns the reader that's being used.

◆ getNextAudioBlock()

void juce::AudioFormatReaderSource::getNextAudioBlock ( const AudioSourceChannelInfo )
overridevirtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

◆ getNextReadPosition()

int64 juce::AudioFormatReaderSource::getNextReadPosition ( ) const
overridevirtual

Implements the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

◆ getTotalLength()

int64 juce::AudioFormatReaderSource::getTotalLength ( ) const
overridevirtual

Implements the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

◆ isLooping()

bool juce::AudioFormatReaderSource::isLooping ( ) const
inlineoverridevirtual

Returns whether loop-mode is turned on or not.

Implements juce::PositionableAudioSource.

◆ prepareToPlay()

void juce::AudioFormatReaderSource::prepareToPlay ( int  samplesPerBlockExpected,
double  sampleRate 
)
overridevirtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

◆ releaseResources()

void juce::AudioFormatReaderSource::releaseResources ( )
overridevirtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

◆ setLooping()

void juce::AudioFormatReaderSource::setLooping ( bool  shouldLoop)
overridevirtual

Toggles loop-mode.

If set to true, it will continuously loop the input source. If false, it will just emit silence after the source has finished.

See also
isLooping

Reimplemented from juce::PositionableAudioSource.

◆ setNextReadPosition()

void juce::AudioFormatReaderSource::setNextReadPosition ( int64  newPosition)
overridevirtual

Implements the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

Member Data Documentation

◆ looping

bool juce::AudioFormatReaderSource::looping
private

◆ nextPlayPos

int64 juce::AudioFormatReaderSource::nextPlayPos
private

◆ reader

OptionalScopedPointer<AudioFormatReader> juce::AudioFormatReaderSource::reader
private

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