|
OpenShot Library | libopenshot 1.1.1
|
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 34 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 23 of file AudioReaderSource.cpp.
| AudioReaderSource::~AudioReaderSource | ( | ) |
Destructor.
Definition at line 29 of file AudioReaderSource.cpp.
| std::shared_ptr< Frame > AudioReaderSource::getFrame | ( | ) | const |
Return the current frame object.
Definition at line 169 of file AudioReaderSource.cpp.
| 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 34 of file AudioReaderSource.cpp.
|
inline |
Get the next read position of this source.
Definition at line 77 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 95 of file AudioReaderSource.h.
| juce::int64 AudioReaderSource::getTotalLength | ( | ) | const |
Get the total length (in samples) of this audio source.
Definition at line 186 of file AudioReaderSource.cpp.
|
inline |
Looping is not support in OpenShot audio playback (this is always false)
Definition at line 83 of file AudioReaderSource.h.
| void AudioReaderSource::prepareToPlay | ( | int | , |
| double | |||
| ) |
Prepare to play this audio source.
Definition at line 180 of file AudioReaderSource.cpp.
|
inline |
Get Reader.
Definition at line 103 of file AudioReaderSource.h.
|
inline |
Set Reader.
Definition at line 101 of file AudioReaderSource.h.
| void AudioReaderSource::releaseResources | ( | ) |
Release all resources.
Definition at line 183 of file AudioReaderSource.cpp.
| void AudioReaderSource::Seek | ( | int64_t | new_position | ) |
Seek to a specific frame.
Definition at line 159 of file AudioReaderSource.cpp.
|
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 87 of file AudioReaderSource.h.
|
inline |
Set the next read position of this source.
| newPosition | The sample # to start reading from |
Definition at line 74 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 93 of file AudioReaderSource.h.
|
inline |
Set playback video cache thread (for pre-roll reference)
Definition at line 98 of file AudioReaderSource.h.