JUCE  v5.1.1-3-g1a0b28c73
JUCE API
AudioSourceChannelInfo Struct Reference

Used by AudioSource::getNextAudioBlock(). More...

#include <juce_AudioSource.h>

Collaboration diagram for AudioSourceChannelInfo:

Public Member Functions

 AudioSourceChannelInfo () noexcept
 Creates an uninitialised AudioSourceChannelInfo. More...
 
 AudioSourceChannelInfo (AudioSampleBuffer *bufferToUse, int startSampleOffset, int numSamplesToUse) noexcept
 Creates an AudioSourceChannelInfo. More...
 
 AudioSourceChannelInfo (AudioSampleBuffer &bufferToUse) noexcept
 Creates an AudioSourceChannelInfo that uses the whole of a buffer. More...
 
void clearActiveBufferRegion () const
 Convenient method to clear the buffer if the source is not producing any data. More...
 

Public Attributes

AudioSampleBufferbuffer
 The destination buffer to fill with audio data. More...
 
int numSamples
 The number of samples in the buffer which the callback is expected to fill with data. More...
 
int startSample
 The first sample in the buffer from which the callback is expected to write data. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ AudioSourceChannelInfo() [1/3]

AudioSourceChannelInfo::AudioSourceChannelInfo ( )
inlinenoexcept

Creates an uninitialised AudioSourceChannelInfo.

◆ AudioSourceChannelInfo() [2/3]

AudioSourceChannelInfo::AudioSourceChannelInfo ( AudioSampleBuffer bufferToUse,
int  startSampleOffset,
int  numSamplesToUse 
)
inlinenoexcept

◆ AudioSourceChannelInfo() [3/3]

AudioSourceChannelInfo::AudioSourceChannelInfo ( AudioSampleBuffer bufferToUse)
inlineexplicitnoexcept

Creates an AudioSourceChannelInfo that uses the whole of a buffer.

Note that the buffer provided must not be deleted while the AudioSourceChannelInfo is still using it.

Member Function Documentation

◆ clearActiveBufferRegion()

void AudioSourceChannelInfo::clearActiveBufferRegion ( ) const
inline

Convenient method to clear the buffer if the source is not producing any data.

References AudioBuffer< Type >::clear().

Member Data Documentation

◆ buffer

AudioSampleBuffer* AudioSourceChannelInfo::buffer

The destination buffer to fill with audio data.

When the AudioSource::getNextAudioBlock() method is called, the active section of this buffer should be filled with whatever output the source produces.

Only the samples specified by the startSample and numSamples members of this structure should be affected by the call.

The contents of the buffer when it is passed to the AudioSource::getNextAudioBlock() method can be treated as the input if the source is performing some kind of filter operation, but should be cleared if this is not the case - the clearActiveBufferRegion() is a handy way of doing this.

The number of channels in the buffer could be anything, so the AudioSource must cope with this in whatever way is appropriate for its function.

◆ numSamples

int AudioSourceChannelInfo::numSamples

The number of samples in the buffer which the callback is expected to fill with data.

◆ startSample

int AudioSourceChannelInfo::startSample

The first sample in the buffer from which the callback is expected to write data.


The documentation for this struct was generated from the following file: