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