OpenShot Library | libopenshot
0.2.7
|
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... | |
ReaderBase * | Reader () const |
Get Reader. More... | |
void | Reader (ReaderBase *audio_reader) |
Set 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 38 of file AudioReaderSource.cpp.
AudioReaderSource::~AudioReaderSource | ( | ) |
Destructor.
Definition at line 50 of file AudioReaderSource.cpp.
|
inline |
Get the estimate frame that is playing at this moment.
Definition at line 116 of file AudioReaderSource.h.
|
inline |
Return the current frame object.
Definition at line 113 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 179 of file AudioReaderSource.cpp.
juce::int64 AudioReaderSource::getNextReadPosition | ( | ) | const |
Get the next read position of this source.
Definition at line 258 of file AudioReaderSource.cpp.
|
inline |
Definition at line 110 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 121 of file AudioReaderSource.h.
juce::int64 AudioReaderSource::getTotalLength | ( | ) | const |
Get the total length (in samples) of this audio source.
Definition at line 265 of file AudioReaderSource.cpp.
bool AudioReaderSource::isLooping | ( | ) | const |
Determines if this audio source should repeat when it reaches the end.
Definition at line 275 of file AudioReaderSource.cpp.
void AudioReaderSource::prepareToPlay | ( | int | , |
double | |||
) |
Prepare to play this audio source.
Definition at line 244 of file AudioReaderSource.cpp.
|
inline |
Get Reader.
Definition at line 126 of file AudioReaderSource.h.
|
inline |
Set Reader.
Definition at line 124 of file AudioReaderSource.h.
void AudioReaderSource::releaseResources | ( | ) |
Release all resources.
Definition at line 247 of file AudioReaderSource.cpp.
|
inline |
Seek to a specific frame.
Definition at line 129 of file AudioReaderSource.h.
void AudioReaderSource::setBuffer | ( | juce::AudioSampleBuffer * | audio_buffer | ) |
Update the internal buffer used by this source.
Definition at line 289 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 282 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 250 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 119 of file AudioReaderSource.h.