OpenShot Library | libopenshot
0.2.4
|
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 juce::AudioSourceChannelInfo &info) |
Get the next block of audio samples. More... | |
juce::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... | |
juce::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 (juce::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 (juce::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 47 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 37 of file AudioReaderSource.cpp.
AudioReaderSource::~AudioReaderSource | ( | ) |
Destructor.
Definition at line 49 of file AudioReaderSource.cpp.
|
inline |
Get the estimate frame that is playing at this moment.
Definition at line 117 of file AudioReaderSource.h.
|
inline |
Return the current frame object.
Definition at line 114 of file AudioReaderSource.h.
void AudioReaderSource::getNextAudioBlock | ( | const juce::AudioSourceChannelInfo & | info | ) |
Get the next block of audio samples.
info | This struct informs us of which samples are needed next. |
Definition at line 180 of file AudioReaderSource.cpp.
juce::int64 AudioReaderSource::getNextReadPosition | ( | ) | const |
Get the next read position of this source.
Definition at line 259 of file AudioReaderSource.cpp.
|
inline |
Definition at line 111 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 122 of file AudioReaderSource.h.
juce::int64 AudioReaderSource::getTotalLength | ( | ) | const |
Get the total length (in samples) of this audio source.
Definition at line 266 of file AudioReaderSource.cpp.
bool AudioReaderSource::isLooping | ( | ) | const |
Determines if this audio source should repeat when it reaches the end.
Definition at line 276 of file AudioReaderSource.cpp.
void AudioReaderSource::prepareToPlay | ( | int | , |
double | |||
) |
Prepare to play this audio source.
Definition at line 245 of file AudioReaderSource.cpp.
|
inline |
Set Reader.
Definition at line 125 of file AudioReaderSource.h.
|
inline |
Get Reader.
Definition at line 127 of file AudioReaderSource.h.
void AudioReaderSource::releaseResources | ( | ) |
Release all resources.
Definition at line 248 of file AudioReaderSource.cpp.
|
inline |
Seek to a specific frame.
Definition at line 130 of file AudioReaderSource.h.
void AudioReaderSource::setBuffer | ( | juce::AudioSampleBuffer * | audio_buffer | ) |
Update the internal buffer used by this source.
Definition at line 290 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 283 of file AudioReaderSource.cpp.
void AudioReaderSource::setNextReadPosition | ( | juce::int64 | newPosition | ) |
Set the next read position of this source.
newPosition | The sample # to start reading from |
Definition at line 251 of file AudioReaderSource.cpp.
Referenced by setBuffer().
|
inline |
Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
Definition at line 120 of file AudioReaderSource.h.