OpenShot Audio Library | OpenShotAudio: juce::ARAAudioSourceReader Class Reference

OpenShot Audio Library | OpenShotAudio 0.4.0

Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::ARAAudioSourceReader Class Reference

`#include <juce_ARAAudioReaders.h>`

Inheritance diagram for juce::ARAAudioSourceReader:

## Public Member Functions
| ARAAudioSourceReader (ARAAudioSource *audioSource)
bool | readSamples (int *const *destSamples, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, int numSamples) override
bool | isValid () const
void | invalidate ()
void | willUpdateAudioSourceProperties (ARAAudioSource *audioSource, ARAAudioSource::PropertiesPtr newProperties) override
void | doUpdateAudioSourceContent (ARAAudioSource *audioSource, ARAContentUpdateScopes scopeFlags) override
void | willEnableAudioSourceSamplesAccess (ARAAudioSource *audioSource, bool enable) override
void | didEnableAudioSourceSamplesAccess (ARAAudioSource *audioSource, bool enable) override
void | willDestroyAudioSource (ARAAudioSource *audioSource) override
Public Member Functions inherited from juce::AudioFormatReader
virtual | ~AudioFormatReader ()
const String & | getFormatName () const noexcept
bool | read (float *const *destChannels, int numDestChannels, int64 startSampleInSource, int numSamplesToRead)
bool | read (int *const *destChannels, int numDestChannels, int64 startSampleInSource, int numSamplesToRead, bool fillLeftoverChannelsWithCopies)
bool | read (AudioBuffer< float > *buffer, int startSampleInDestBuffer, int numSamples, int64 readerStartSample, bool useReaderLeftChan, bool useReaderRightChan)
virtual void | readMaxLevels (int64 startSample, int64 numSamples, Range< float > *results, int numChannelsToRead)
virtual void | readMaxLevels (int64 startSample, int64 numSamples, float &lowestLeft, float &highestLeft, float &lowestRight, float &highestRight)
int64 | searchForLevel (int64 startSample, int64 numSamplesToSearch, double magnitudeRangeMinimum, double magnitudeRangeMaximum, int minimumConsecutiveSamples)
virtual AudioChannelSet | getChannelLayout ()

## Additional Inherited Members
Public Attributes inherited from juce::AudioFormatReader
double | sampleRate = 0
unsigned int | bitsPerSample = 0
int64 | lengthInSamples = 0
unsigned int | numChannels = 0
bool | usesFloatingPointData = false
StringPairArray | metadataValues
InputStream * | input
Protected Member Functions inherited from juce::AudioFormatReader
| AudioFormatReader (InputStream *sourceStream, const String &formatName)
Static Protected Member Functions inherited from juce::AudioFormatReader
static void | clearSamplesBeyondAvailableLength (int *const *destChannels, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, int &numSamples, int64 fileLengthInSamples)

## Detailed Description

Subclass of AudioFormatReader that reads samples from a single ARA audio source.

Plug-Ins typically use this from their rendering code, wrapped in a BufferingAudioReader to bridge between realtime rendering and non-realtime audio reading.

The reader becomes invalidated if

- the audio source content is updated in a way that affects its samples,
- the audio source sample access is disabled, or
- the audio source being read is destroyed.

Definition at line 77 of file juce_ARAAudioReaders.h.

## Constructor & Destructor Documentation

## ◆ ARAAudioSourceReader()

juce::ARAAudioSourceReader::ARAAudioSourceReader | ( | ARAAudioSource * | audioSource | ) |
| explicit

Use an ARAAudioSource to construct an audio source reader for the given `audioSource`.

Definition at line 29 of file juce_ARAAudioReaders.cpp.

## ◆ ~ARAAudioSourceReader()

juce::ARAAudioSourceReader::~ARAAudioSourceReader | ( |  | ) |
| override

Definition at line 48 of file juce_ARAAudioReaders.cpp.

## Member Function Documentation

## ◆ didEnableAudioSourceSamplesAccess()

void juce::ARAAudioSourceReader::didEnableAudioSourceSamplesAccess | ( | ARAAudioSource * | audioSource,
|  | bool | enable )
| override

Definition at line 99 of file juce_ARAAudioReaders.cpp.

## ◆ doUpdateAudioSourceContent()

void juce::ARAAudioSourceReader::doUpdateAudioSourceContent | ( | ARAAudioSource * | audioSource,
|  | ARAContentUpdateScopes | scopeFlags )
| override

Definition at line 77 of file juce_ARAAudioReaders.cpp.

## ◆ invalidate()

void juce::ARAAudioSourceReader::invalidate | ( |  | ) |

Invalidate the reader - the reader will call this internally if needed, but can also be invalidated from the outside (from message thread only!).

Definition at line 53 of file juce_ARAAudioReaders.cpp.

## ◆ isValid()

bool juce::ARAAudioSourceReader::isValid | ( |  | ) | const
| inline

Returns true as long as the reader's underlying ARAAudioSource remains accessible and its sample content is not changed.

Definition at line 95 of file juce_ARAAudioReaders.h.

Referenced by invalidate(), and readSamples().

## ◆ readSamples()

bool juce::ARAAudioSourceReader::readSamples | ( | int *const * | destChannels,
|  | int | numDestChannels,
|  | int | startOffsetInDestBuffer,
|  | int64 | startSampleInFile,
|  | int | numSamples )
| overridevirtual

Subclasses must implement this method to perform the low-level read operation.

Callers should use read() instead of calling this directly.

Parameters

  destChannels | the array of destination buffers to fill. Some of these pointers may be null
  numDestChannels | the number of items in the destChannels array. This value is guaranteed not to be greater than the number of channels that this reader object contains
  startOffsetInDestBuffer | the number of samples from the start of the dest data at which to begin writing
  startSampleInFile | the number of samples into the source data at which to begin reading. This value is guaranteed to be >= 0.
  numSamples | the number of samples to read

Implements juce::AudioFormatReader.

Definition at line 118 of file juce_ARAAudioReaders.cpp.

## ◆ willDestroyAudioSource()

void juce::ARAAudioSourceReader::willDestroyAudioSource | ( | ARAAudioSource * | audioSource | ) |
| override

Definition at line 111 of file juce_ARAAudioReaders.cpp.

## ◆ willEnableAudioSourceSamplesAccess()

void juce::ARAAudioSourceReader::willEnableAudioSourceSamplesAccess | ( | ARAAudioSource * | audioSource,
|  | bool | enable )
| override

Definition at line 87 of file juce_ARAAudioReaders.cpp.

## ◆ willUpdateAudioSourceProperties()

void juce::ARAAudioSourceReader::willUpdateAudioSourceProperties | ( | ARAAudioSource * | audioSource,
|  | ARAAudioSource::PropertiesPtr | newProperties )
| override

Definition at line 66 of file juce_ARAAudioReaders.cpp.

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

- juce_ARAAudioReaders.h
- juce_ARAAudioReaders.cpp