OpenShot Library | libopenshot
0.3.3
|
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) | |
The cache thread (for pre-roll checking) 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... | |
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 |
Looping is not support in OpenShot audio playback (this is always false) 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 | setLooping (bool shouldLoop) |
This method is ignored (we do not support looping audio playback) 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... | |
void | setVideoCache (openshot::VideoCacheThread *newCache) |
Set playback video cache thread (for pre-roll reference) 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 31 of file AudioReaderSource.h.
AudioReaderSource::AudioReaderSource | ( | ReaderBase * | audio_reader, |
int64_t | starting_frame_number | ||
) |
The cache thread (for pre-roll checking)
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. |
Definition at line 22 of file AudioReaderSource.cpp.
AudioReaderSource::~AudioReaderSource | ( | ) |
Destructor.
Definition at line 28 of file AudioReaderSource.cpp.
|
inline |
Return the current frame object.
Definition at line 81 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 33 of file AudioReaderSource.cpp.
|
inline |
Get the next read position of this source.
Definition at line 68 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 86 of file AudioReaderSource.h.
juce::int64 AudioReaderSource::getTotalLength | ( | ) | const |
Get the total length (in samples) of this audio source.
Definition at line 102 of file AudioReaderSource.cpp.
|
inline |
Looping is not support in OpenShot audio playback (this is always false)
Definition at line 74 of file AudioReaderSource.h.
void AudioReaderSource::prepareToPlay | ( | int | , |
double | |||
) |
Prepare to play this audio source.
Definition at line 96 of file AudioReaderSource.cpp.
|
inline |
Get Reader.
Definition at line 94 of file AudioReaderSource.h.
|
inline |
Set Reader.
Definition at line 92 of file AudioReaderSource.h.
void AudioReaderSource::releaseResources | ( | ) |
Release all resources.
Definition at line 99 of file AudioReaderSource.cpp.
|
inline |
Seek to a specific frame.
Definition at line 97 of file AudioReaderSource.h.
|
inline |
This method is ignored (we do not support looping audio playback)
shouldLoop | Determines if the audio source should repeat when it reaches the end |
Definition at line 78 of file AudioReaderSource.h.
|
inline |
Set the next read position of this source.
newPosition | The sample # to start reading from |
Definition at line 65 of file AudioReaderSource.h.
|
inline |
Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
Definition at line 84 of file AudioReaderSource.h.
|
inline |
Set playback video cache thread (for pre-roll reference)
Definition at line 89 of file AudioReaderSource.h.