OpenShot Library | libopenshot
0.1.9
|
This class is used to expose an AudioSampleBuffer as an AudioSource in JUCE. More...
#include <AudioBufferSource.h>
Public Member Functions | |
AudioBufferSource (AudioSampleBuffer *audio_buffer) | |
Default constructor. More... | |
void | getNextAudioBlock (const AudioSourceChannelInfo &info) |
Get the next block of audio samples. More... | |
int64 | getNextReadPosition () const |
Get the next read position of this source. More... | |
int64 | getTotalLength () const |
Get the total length (in samples) of this audio source. More... | |
bool | isLooping () const |
Determines if this audio source should repeat when it reaches the end. More... | |
void | prepareToPlay (int, double) |
Prepare to play this audio source. More... | |
void | releaseResources () |
Release all resources. More... | |
void | setBuffer (AudioSampleBuffer *audio_buffer) |
Update the internal buffer used by this source. More... | |
void | setLooping (bool shouldLoop) |
Set if this audio source should repeat when it reaches the end. More... | |
void | setNextReadPosition (int64 newPosition) |
Set the next read position of this source. More... | |
~AudioBufferSource () | |
Destructor. More... | |
This class is used to expose an AudioSampleBuffer as an AudioSource in JUCE.
The JUCE library cannot play audio directly from an AudioSampleBuffer, so this class exposes an AudioSampleBuffer as a AudioSource, so that JUCE can play the audio.
Definition at line 54 of file AudioBufferSource.h.
AudioBufferSource::AudioBufferSource | ( | AudioSampleBuffer * | audio_buffer | ) |
Default constructor.
audio_buffer | This buffer contains the samples you want to play through JUCE. |
Definition at line 34 of file AudioBufferSource.cpp.
AudioBufferSource::~AudioBufferSource | ( | ) |
Destructor.
Definition at line 39 of file AudioBufferSource.cpp.
void AudioBufferSource::getNextAudioBlock | ( | const AudioSourceChannelInfo & | info | ) |
Get the next block of audio samples.
info | This struct informs us of which samples are needed next. |
Definition at line 46 of file AudioBufferSource.cpp.
int64 AudioBufferSource::getNextReadPosition | ( | ) | const |
Get the next read position of this source.
Definition at line 106 of file AudioBufferSource.cpp.
int64 AudioBufferSource::getTotalLength | ( | ) | const |
Get the total length (in samples) of this audio source.
Definition at line 113 of file AudioBufferSource.cpp.
bool AudioBufferSource::isLooping | ( | ) | const |
Determines if this audio source should repeat when it reaches the end.
Definition at line 120 of file AudioBufferSource.cpp.
void AudioBufferSource::prepareToPlay | ( | int | , |
double | |||
) |
Prepare to play this audio source.
Definition at line 92 of file AudioBufferSource.cpp.
void AudioBufferSource::releaseResources | ( | ) |
Release all resources.
Definition at line 95 of file AudioBufferSource.cpp.
void AudioBufferSource::setBuffer | ( | AudioSampleBuffer * | audio_buffer | ) |
Update the internal buffer used by this source.
Definition at line 134 of file AudioBufferSource.cpp.
void AudioBufferSource::setLooping | ( | bool | shouldLoop | ) |
Set if this audio source should repeat when it reaches the end.
shouldLoop | Determines if the audio source should repeat when it reaches the end |
Definition at line 127 of file AudioBufferSource.cpp.
void AudioBufferSource::setNextReadPosition | ( | int64 | newPosition | ) |
Set the next read position of this source.
newPosition | The sample # to start reading from |
Definition at line 98 of file AudioBufferSource.cpp.