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:

## Public Member Functions

| AudioReaderSource (ReaderBase *audio_reader, int64_t starting_frame_number, int buffer_size)
| Constructor that reads samples from a reader. More...
int64_t | getEstimatedFrame () const
| Get the estimate frame that is playing at this moment. More...
std::shared_ptr< Frame > | getFrame () const
| Return the current frame object. More...
void | getNextAudioBlock (const AudioSourceChannelInfo &info)
| Get the next block of audio samples. More...
int64 | getNextReadPosition () const
| Get the next read position of this source. More...
const ReaderInfo & | getReaderInfo () const
int | getSpeed () const
| Get Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...) More...
int64 | getTotalLength () const
| Get the total length (in samples) of this audio source. More...
bool | isLooping () const
| Determines if this audio source should repeat when it reaches the end. 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 | setBuffer (AudioSampleBuffer *audio_buffer)
| Update the internal buffer used by this source. More...
void | setLooping (bool shouldLoop)
| Set if this audio source should repeat when it reaches the end. More...
void | setNextReadPosition (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...
| ~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 54 of file AudioReaderSource.h.

## Constructor & Destructor Documentation

## AudioReaderSource()

AudioReaderSource::AudioReaderSource | ( | ReaderBase * | audio_reader,
|  | int64_t | starting_frame_number,
|  | int | buffer_size
| ) |  |

Constructor that reads samples from a reader.

Parameters

  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.
  buffer_size | The max number of samples to keep in the buffer at one time.

Definition at line 34 of file AudioReaderSource.cpp.

## ~AudioReaderSource()

AudioReaderSource::~AudioReaderSource | ( |  | ) |

Destructor.

Definition at line 46 of file AudioReaderSource.cpp.

## Member Function Documentation

## getEstimatedFrame()

int64_t openshot::AudioReaderSource::getEstimatedFrame | ( |  | ) | const

inline

Get the estimate frame that is playing at this moment.

Definition at line 124 of file AudioReaderSource.h.

## getFrame()

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

inline

Return the current frame object.

Definition at line 121 of file AudioReaderSource.h.

## getNextAudioBlock()

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

Get the next block of audio samples.

Parameters

  info | This struct informs us of which samples are needed next.

Definition at line 177 of file AudioReaderSource.cpp.

## getNextReadPosition()

int64 AudioReaderSource::getNextReadPosition | ( |  | ) | const

Get the next read position of this source.

Definition at line 256 of file AudioReaderSource.cpp.

## getReaderInfo()

const ReaderInfo& openshot::AudioReaderSource::getReaderInfo | ( |  | ) | const

inline

Definition at line 118 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 129 of file AudioReaderSource.h.

## getTotalLength()

int64 AudioReaderSource::getTotalLength | ( |  | ) | const

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

Definition at line 263 of file AudioReaderSource.cpp.

## isLooping()

bool AudioReaderSource::isLooping | ( |  | ) | const

Determines if this audio source should repeat when it reaches the end.

Definition at line 273 of file AudioReaderSource.cpp.

## prepareToPlay()

void AudioReaderSource::prepareToPlay | ( | int | ,
|  | double |
| ) |  |

Prepare to play this audio source.

Definition at line 242 of file AudioReaderSource.cpp.

## Reader() [1/2]

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

inline

Get Reader.

Definition at line 134 of file AudioReaderSource.h.

## Reader() [2/2]

void openshot::AudioReaderSource::Reader | ( | ReaderBase * | audio_reader | ) |

inline

Set Reader.

Definition at line 132 of file AudioReaderSource.h.

## releaseResources()

void AudioReaderSource::releaseResources | ( |  | ) |

Release all resources.

Definition at line 245 of file AudioReaderSource.cpp.

## Seek()

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

inline

Seek to a specific frame.

Definition at line 137 of file AudioReaderSource.h.

## setBuffer()

void AudioReaderSource::setBuffer | ( | AudioSampleBuffer * | audio_buffer | ) |

Update the internal buffer used by this source.

Definition at line 287 of file AudioReaderSource.cpp.

## setLooping()

void AudioReaderSource::setLooping | ( | bool | shouldLoop | ) |

Set if this audio source should repeat when it reaches the end.

Parameters

  shouldLoop | Determines if the audio source should repeat when it reaches the end

Definition at line 280 of file AudioReaderSource.cpp.

## setNextReadPosition()

void AudioReaderSource::setNextReadPosition | ( | int64 | newPosition | ) |

Set the next read position of this source.

Parameters

  newPosition | The sample # to start reading from

Definition at line 248 of file AudioReaderSource.cpp.

## 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 127 of file AudioReaderSource.h.

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

- AudioReaderSource.h
- AudioReaderSource.cpp