LMMS
Loading...
Searching...
No Matches
juce::ARAAudioSourceReader Class Reference

#include <juce_ARAAudioReaders.h>

Inheritance diagram for juce::ARAAudioSourceReader:
juce::AudioFormatReader juce::ARAAudioSourceListener

Public Member Functions

 ARAAudioSourceReader (ARAAudioSource *audioSource)
 ~ARAAudioSourceReader () override
bool readSamples (int **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 StringgetFormatName () 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 ()

Private Attributes

ARAAudioSourceaudioSourceBeingRead
std::unique_ptr< ARA::PlugIn::HostAudioReader > hostReader
ReadWriteLock lock
std::vector< void * > tmpPtrs

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
InputStreaminput
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 **destChannels, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, int &numSamples, int64 fileLengthInSamples)
Private Member Functions inherited from juce::ARAAudioSourceListener
virtual ~ARAAudioSourceListener ()=default
virtual void didUpdateAudioSourceProperties (ARAAudioSource *audioSource)
virtual void didUpdateAudioSourceAnalysisProgress (ARAAudioSource *audioSource, ARA::ARAAnalysisProgressState state, float progress)
virtual void willDeactivateAudioSourceForUndoHistory (ARAAudioSource *audioSource, bool deactivate)
virtual void didDeactivateAudioSourceForUndoHistory (ARAAudioSource *audioSource, bool deactivate)
virtual void didAddAudioModificationToAudioSource (ARAAudioSource *audioSource, ARAAudioModification *audioModification)
virtual void willRemoveAudioModificationFromAudioSource (ARAAudioSource *audioSource, ARAAudioModification *audioModification)

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.

@tags{ARA}

Constructor & Destructor Documentation

◆ ARAAudioSourceReader()

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

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

◆ ~ARAAudioSourceReader()

juce::ARAAudioSourceReader::~ARAAudioSourceReader ( )
override

Member Function Documentation

◆ didEnableAudioSourceSamplesAccess()

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

Called after access to an audio source's samples is enabled or disabled.

Parameters
audioSourceThe audio source whose sample access state was changed.
enableA bool indicating whether or not sample access was enabled or disabled.

Reimplemented from juce::ARAAudioSourceListener.

◆ doUpdateAudioSourceContent()

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

Called when the audio source's content (i.e. samples or notes) changes.

Parameters
audioSourceThe audio source with updated content.
scopeFlagsThe scope of the content update.

Reimplemented from juce::ARAAudioSourceListener.

◆ 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!).

◆ 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.

◆ readSamples()

bool juce::ARAAudioSourceReader::readSamples ( int ** 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
destChannelsthe array of destination buffers to fill. Some of these pointers may be null
numDestChannelsthe 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
startOffsetInDestBufferthe number of samples from the start of the dest data at which to begin writing
startSampleInFilethe number of samples into the source data at which to begin reading. This value is guaranteed to be >= 0.
numSamplesthe number of samples to read

Implements juce::AudioFormatReader.

◆ willDestroyAudioSource()

void juce::ARAAudioSourceReader::willDestroyAudioSource ( ARAAudioSource * audioSource)
overridevirtual

Called before the audio source is destroyed.

Parameters
audioSourceThe audio source that will be destroyed.

Reimplemented from juce::ARAAudioSourceListener.

◆ willEnableAudioSourceSamplesAccess()

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

Called before access to an audio source's samples is enabled or disabled.

Parameters
audioSourceThe audio source whose sample access state will be changed.
enableA bool indicating whether or not sample access will be enabled or disabled.

Reimplemented from juce::ARAAudioSourceListener.

◆ willUpdateAudioSourceProperties()

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

Called before the audio source's properties are updated.

Parameters
audioSourceThe audio source whose properties will be updated.
newPropertiesThe audio source properties that will be assigned to audioSource.

Reimplemented from juce::ARAAudioSourceListener.

Member Data Documentation

◆ audioSourceBeingRead

ARAAudioSource* juce::ARAAudioSourceReader::audioSourceBeingRead
private

◆ hostReader

std::unique_ptr<ARA::PlugIn::HostAudioReader> juce::ARAAudioSourceReader::hostReader
private

◆ lock

ReadWriteLock juce::ARAAudioSourceReader::lock
private

◆ tmpPtrs

std::vector<void*> juce::ARAAudioSourceReader::tmpPtrs
private

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