OpenShot Library | libopenshot
0.1.9
|
This class is used to expose any ReaderBase derived class as an AudioSource in JUCE. More...
#include <AudioReaderSource.h>
Public Member Functions | |
AudioReaderSource (ReaderBase *audio_reader, int64_t starting_frame_number, int buffer_size) | |
Constructor that reads samples from a reader. More... | |
int64_t | getEstimatedFrame () const |
Get the estimate frame that is playing at this moment. More... | |
std::shared_ptr< Frame > | getFrame () const |
Return the current frame object. 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... | |
const ReaderInfo & | getReaderInfo () const |
int | getSpeed () const |
Get Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...) 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 | Reader (ReaderBase *audio_reader) |
Set Reader. More... | |
ReaderBase * | Reader () const |
Get Reader. More... | |
void | releaseResources () |
Release all resources. More... | |
void | Seek (int64_t new_position) |
Seek to a specific frame. 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... | |
void | setSpeed (int new_speed) |
Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...) More... | |
~AudioReaderSource () | |
Destructor. More... | |
This class is used to expose any ReaderBase derived class as an AudioSource in JUCE.
This allows any reader to play audio through JUCE (our audio framework).
Definition at line 54 of file AudioReaderSource.h.
AudioReaderSource::AudioReaderSource | ( | ReaderBase * | audio_reader, |
int64_t | starting_frame_number, | ||
int | buffer_size | ||
) |
Constructor that reads samples from a reader.
audio_reader | This reader provides constant samples from a ReaderBase derived class |
starting_frame_number | This is the frame number to start reading samples from the reader. |
buffer_size | The max number of samples to keep in the buffer at one time. |
Definition at line 34 of file AudioReaderSource.cpp.
AudioReaderSource::~AudioReaderSource | ( | ) |
Destructor.
Definition at line 46 of file AudioReaderSource.cpp.
|
inline |
Get the estimate frame that is playing at this moment.
Definition at line 124 of file AudioReaderSource.h.
|
inline |
Return the current frame object.
Definition at line 121 of file AudioReaderSource.h.
void AudioReaderSource::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 177 of file AudioReaderSource.cpp.
int64 AudioReaderSource::getNextReadPosition | ( | ) | const |
Get the next read position of this source.
Definition at line 256 of file AudioReaderSource.cpp.
|
inline |
Definition at line 118 of file AudioReaderSource.h.
|
inline |
Get Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
Definition at line 129 of file AudioReaderSource.h.
int64 AudioReaderSource::getTotalLength | ( | ) | const |
Get the total length (in samples) of this audio source.
Definition at line 263 of file AudioReaderSource.cpp.
bool AudioReaderSource::isLooping | ( | ) | const |
Determines if this audio source should repeat when it reaches the end.
Definition at line 273 of file AudioReaderSource.cpp.
void AudioReaderSource::prepareToPlay | ( | int | , |
double | |||
) |
Prepare to play this audio source.
Definition at line 242 of file AudioReaderSource.cpp.
|
inline |
Set Reader.
Definition at line 132 of file AudioReaderSource.h.
|
inline |
Get Reader.
Definition at line 134 of file AudioReaderSource.h.
void AudioReaderSource::releaseResources | ( | ) |
Release all resources.
Definition at line 245 of file AudioReaderSource.cpp.
|
inline |
Seek to a specific frame.
Definition at line 137 of file AudioReaderSource.h.
void AudioReaderSource::setBuffer | ( | AudioSampleBuffer * | audio_buffer | ) |
Update the internal buffer used by this source.
Definition at line 287 of file AudioReaderSource.cpp.
void AudioReaderSource::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 280 of file AudioReaderSource.cpp.
void AudioReaderSource::setNextReadPosition | ( | int64 | newPosition | ) |
Set the next read position of this source.
newPosition | The sample # to start reading from |
Definition at line 248 of file AudioReaderSource.cpp.
|
inline |
Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
Definition at line 127 of file AudioReaderSource.h.