openshot-audio  0.1.7
Public Member Functions | List of all members
BufferingAudioSource Class Reference

#include <juce_BufferingAudioSource.h>

Inheritance diagram for BufferingAudioSource:
PositionableAudioSource TimeSliceClient AudioSource

Public Member Functions

 BufferingAudioSource (PositionableAudioSource *source, TimeSliceThread &backgroundThread, bool deleteSourceWhenDeleted, int numberOfSamplesToBuffer, int numberOfChannels=2)
 
 ~BufferingAudioSource ()
 
void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override
 
void releaseResources () override
 
void getNextAudioBlock (const AudioSourceChannelInfo &) override
 
void setNextReadPosition (int64 newPosition) override
 
int64 getNextReadPosition () const override
 
int64 getTotalLength () const override
 
bool isLooping () const override
 
- Public Member Functions inherited from PositionableAudioSource
 ~PositionableAudioSource ()
 
virtual void setLooping (bool shouldLoop)
 
- Public Member Functions inherited from AudioSource
virtual ~AudioSource ()
 

Additional Inherited Members

- Protected Member Functions inherited from PositionableAudioSource
 PositionableAudioSource () noexcept
 
- Protected Member Functions inherited from AudioSource
 AudioSource () noexcept
 

Detailed Description

An AudioSource which takes another source as input, and buffers it using a thread.

Create this as a wrapper around another thread, and it will read-ahead with a background thread to smooth out playback. You can either create one of these directly, or use it indirectly using an AudioTransportSource.

See also
PositionableAudioSource, AudioTransportSource

Constructor & Destructor Documentation

◆ BufferingAudioSource()

BufferingAudioSource::BufferingAudioSource ( PositionableAudioSource source,
TimeSliceThread backgroundThread,
bool  deleteSourceWhenDeleted,
int  numberOfSamplesToBuffer,
int  numberOfChannels = 2 
)

Creates a BufferingAudioSource.

Parameters
sourcethe input source to read from
backgroundThreada background thread that will be used for the background read-ahead. This object must not be deleted until after any BufferedAudioSources that are using it have been deleted!
deleteSourceWhenDeletedif true, then the input source object will be deleted when this object is deleted
numberOfSamplesToBufferthe size of buffer to use for reading ahead
numberOfChannelsthe number of channels that will be played

◆ ~BufferingAudioSource()

BufferingAudioSource::~BufferingAudioSource ( )

Destructor.

The input source may be deleted depending on whether the deleteSourceWhenDeleted flag was set in the constructor.

Member Function Documentation

◆ getNextAudioBlock()

void BufferingAudioSource::getNextAudioBlock ( const AudioSourceChannelInfo info)
overridevirtual

Implementation of the AudioSource method.

Implements AudioSource.

◆ getNextReadPosition()

int64 BufferingAudioSource::getNextReadPosition ( ) const
overridevirtual

Implements the PositionableAudioSource method.

Implements PositionableAudioSource.

◆ getTotalLength()

int64 BufferingAudioSource::getTotalLength ( ) const
inlineoverridevirtual

Implements the PositionableAudioSource method.

Implements PositionableAudioSource.

◆ isLooping()

bool BufferingAudioSource::isLooping ( ) const
inlineoverridevirtual

Implements the PositionableAudioSource method.

Implements PositionableAudioSource.

◆ prepareToPlay()

void BufferingAudioSource::prepareToPlay ( int  samplesPerBlockExpected,
double  sampleRate 
)
overridevirtual

Implementation of the AudioSource method.

Implements AudioSource.

◆ releaseResources()

void BufferingAudioSource::releaseResources ( )
overridevirtual

Implementation of the AudioSource method.

Implements AudioSource.

◆ setNextReadPosition()

void BufferingAudioSource::setNextReadPosition ( int64  newPosition)
overridevirtual

Implements the PositionableAudioSource method.

Implements PositionableAudioSource.


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