Loading...
Searching...
No Matches
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)
| The cache thread (for pre-roll checking)
std::shared_ptr< Frame > | getFrame () const
| Return the current frame object.
void | getNextAudioBlock (const juce::AudioSourceChannelInfo &info)
| Get the next block of audio samples.
juce::int64 | getNextReadPosition () const
| Get 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...)
juce::int64 | getTotalLength () const
| Get the total length (in samples) of this audio source.
bool | isLooping () const
| Looping is not support in OpenShot audio playback (this is always false)
void | prepareToPlay (int, double)
| Prepare to play this audio source.
ReaderBase * | Reader () const
| Get Reader.
void | Reader (ReaderBase *audio_reader)
| Set Reader.
void | releaseResources ()
| Release all resources.
void | Seek (int64_t new_position)
| Seek to a specific frame.
void | setLooping (bool shouldLoop)
| This method is ignored (we do not support looping audio playback)
void | setNextReadPosition (juce::int64 newPosition)
| Set the next read position of this source.
void | setSpeed (int new_speed)
| Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
void | setVideoCache (openshot::VideoCacheThread *newCache)
| Set playback video cache thread (for pre-roll reference)
| ~AudioReaderSource ()
| Destructor.

## 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_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 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

  info | This 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

  shouldLoop | Determines 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

  newPosition | The 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:

- AudioReaderSource.h
- AudioReaderSource.cpp