OpenShot Library | libopenshot
0.2.5
|
Go to the documentation of this file.
31 #ifndef OPENSHOT_AUDIOREADERSOURCE_H
32 #define OPENSHOT_AUDIOREADERSOURCE_H
36 #include "JuceHeader.h"
53 juce::AudioSampleBuffer *buffer;
57 int64_t original_frame_number;
59 std::shared_ptr<Frame> frame;
60 int64_t frame_position;
61 double estimated_frame;
62 int estimated_samples_per_frame;
65 void GetMoreSamplesFromReader();
68 juce::AudioSampleBuffer* reverse_buffer(juce::AudioSampleBuffer* buffer);
109 void setBuffer (juce::AudioSampleBuffer *audio_buffer);
114 std::shared_ptr<Frame>
getFrame()
const {
return frame; }
120 void setSpeed(
int new_speed) { speed = new_speed; }
130 void Seek(int64_t new_position) { frame_number = new_position; estimated_frame = new_position; }
void Seek(int64_t new_position)
Seek to a specific frame.
bool isLooping() const
Determines if this audio source should repeat when it reaches the end.
const ReaderInfo & getReaderInfo() const
This namespace is the default namespace for all code in the openshot library.
~AudioReaderSource()
Destructor.
void setLooping(bool shouldLoop)
Set if this audio source should repeat when it reaches the end.
int64_t getEstimatedFrame() const
Get the estimate frame that is playing at this moment.
openshot::ReaderInfo info
Information about the current media file.
void prepareToPlay(int, double)
Prepare to play this audio source.
void setBuffer(juce::AudioSampleBuffer *audio_buffer)
Update the internal buffer used by this source.
void setNextReadPosition(juce::int64 newPosition)
Set the next read position of this source.
This struct contains info about a media file, such as height, width, frames per second,...
ReaderBase * Reader() const
Get Reader.
juce::int64 getTotalLength() const
Get the total length (in samples) of this audio source.
void setSpeed(int new_speed)
Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster,...
void Reader(ReaderBase *audio_reader)
Set Reader.
Header file for ReaderBase class.
AudioReaderSource(ReaderBase *audio_reader, int64_t starting_frame_number, int buffer_size)
Constructor that reads samples from a reader.
std::shared_ptr< Frame > getFrame() const
Return the current frame object.
void getNextAudioBlock(const juce::AudioSourceChannelInfo &info)
Get the next block of audio samples.
This abstract class is the base class, used by all readers in libopenshot.
juce::int64 getNextReadPosition() const
Get the next read position of this source.
void releaseResources()
Release all resources.
int getSpeed() const
Get Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster,...
This class is used to expose any ReaderBase derived class as an AudioSource in JUCE.