OpenShot Library | libopenshot  0.3.3
Public Member Functions | List of all members
openshot::AudioReaderSource Class Reference

This class is used to expose any ReaderBase derived class as an AudioSource in JUCE. More...

#include <AudioReaderSource.h>

Inheritance diagram for openshot::AudioReaderSource:
[legend]
Collaboration diagram for openshot::AudioReaderSource:
[legend]

Public Member Functions

 AudioReaderSource (ReaderBase *audio_reader, int64_t starting_frame_number)
 The cache thread (for pre-roll checking) More...
 
std::shared_ptr< FramegetFrame () 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...
 
ReaderBaseReader () 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AudioReaderSource()

AudioReaderSource::AudioReaderSource ( ReaderBase audio_reader,
int64_t  starting_frame_number 
)

The cache thread (for pre-roll checking)

Constructor that reads samples from a reader

Parameters
audio_readerThis reader provides constant samples from a ReaderBase derived class
starting_frame_numberThis is the frame number to start reading samples from the reader.

Definition at line 22 of file AudioReaderSource.cpp.

◆ ~AudioReaderSource()

AudioReaderSource::~AudioReaderSource ( )

Destructor.

Definition at line 28 of file AudioReaderSource.cpp.

Member Function Documentation

◆ getFrame()

std::shared_ptr<Frame> openshot::AudioReaderSource::getFrame ( ) const
inline

Return the current frame object.

Definition at line 81 of file AudioReaderSource.h.

◆ getNextAudioBlock()

void AudioReaderSource::getNextAudioBlock ( const juce::AudioSourceChannelInfo &  info)

Get the next block of audio samples.

Parameters
infoThis struct informs us of which samples are needed next.

Definition at line 33 of file AudioReaderSource.cpp.

◆ getNextReadPosition()

juce::int64 openshot::AudioReaderSource::getNextReadPosition ( ) const
inline

Get the next read position of this source.

Definition at line 68 of file AudioReaderSource.h.

◆ getSpeed()

int openshot::AudioReaderSource::getSpeed ( ) const
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.

◆ getTotalLength()

juce::int64 AudioReaderSource::getTotalLength ( ) const

Get the total length (in samples) of this audio source.

Definition at line 102 of file AudioReaderSource.cpp.

◆ isLooping()

bool openshot::AudioReaderSource::isLooping ( ) const
inline

Looping is not support in OpenShot audio playback (this is always false)

Definition at line 74 of file AudioReaderSource.h.

◆ prepareToPlay()

void AudioReaderSource::prepareToPlay ( int  ,
double   
)

Prepare to play this audio source.

Definition at line 96 of file AudioReaderSource.cpp.

◆ Reader() [1/2]

ReaderBase* openshot::AudioReaderSource::Reader ( ) const
inline

Get Reader.

Definition at line 94 of file AudioReaderSource.h.

◆ Reader() [2/2]

void openshot::AudioReaderSource::Reader ( ReaderBase audio_reader)
inline

Set Reader.

Definition at line 92 of file AudioReaderSource.h.

◆ releaseResources()

void AudioReaderSource::releaseResources ( )

Release all resources.

Definition at line 99 of file AudioReaderSource.cpp.

◆ Seek()

void openshot::AudioReaderSource::Seek ( int64_t  new_position)
inline

Seek to a specific frame.

Definition at line 97 of file AudioReaderSource.h.

◆ setLooping()

void openshot::AudioReaderSource::setLooping ( bool  shouldLoop)
inline

This method is ignored (we do not support looping audio playback)

Parameters
shouldLoopDetermines if the audio source should repeat when it reaches the end

Definition at line 78 of file AudioReaderSource.h.

◆ setNextReadPosition()

void openshot::AudioReaderSource::setNextReadPosition ( juce::int64  newPosition)
inline

Set the next read position of this source.

Parameters
newPositionThe sample # to start reading from

Definition at line 65 of file AudioReaderSource.h.

◆ setSpeed()

void openshot::AudioReaderSource::setSpeed ( int  new_speed)
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.

◆ setVideoCache()

void openshot::AudioReaderSource::setVideoCache ( openshot::VideoCacheThread newCache)
inline

Set playback video cache thread (for pre-roll reference)

Definition at line 89 of file AudioReaderSource.h.


The documentation for this class was generated from the following files: