JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::StandalonePluginHolder::CallbackMaxSizeEnforcer Class Reference
Inheritance diagram for juce::StandalonePluginHolder::CallbackMaxSizeEnforcer:
Collaboration diagram for juce::StandalonePluginHolder::CallbackMaxSizeEnforcer:

Classes

struct  GetChannelWithOffset
 

Public Member Functions

 CallbackMaxSizeEnforcer (AudioIODeviceCallback &callbackIn)
 
void audioDeviceAboutToStart (AudioIODevice *device) override
 Called to indicate that the device is about to start calling back. More...
 
virtual void audioDeviceError (const String &errorMessage)
 This can be overridden to be told if the device generates an error while operating. More...
 
void audioDeviceIOCallback (const float **inputChannelData, int numInputChannels, float **outputChannelData, int numOutputChannels, int numSamples) override
 Processes a block of incoming and outgoing audio data. More...
 
void audioDeviceStopped () override
 Called to indicate that the device has stopped. More...
 

Private Member Functions

template<typename Ptr , typename Vector >
void initChannelPointers (Ptr &&source, Vector &&target, int offset)
 

Private Attributes

AudioIODeviceCallbackinner
 
int maximumSize = 0
 
std::vector< const float * > storedInputChannels
 
std::vector< float * > storedOutputChannels
 

Constructor & Destructor Documentation

◆ CallbackMaxSizeEnforcer()

juce::StandalonePluginHolder::CallbackMaxSizeEnforcer::CallbackMaxSizeEnforcer ( AudioIODeviceCallback callbackIn)
inlineexplicit

Member Function Documentation

◆ audioDeviceAboutToStart()

void juce::StandalonePluginHolder::CallbackMaxSizeEnforcer::audioDeviceAboutToStart ( AudioIODevice device)
inlineoverridevirtual

Called to indicate that the device is about to start calling back.

This will be called just before the audio callbacks begin, either when this callback has just been added to an audio device, or after the device has been restarted because of a sample-rate or block-size change.

You can use this opportunity to find out the sample rate and block size that the device is going to use by calling the AudioIODevice::getCurrentSampleRate() and AudioIODevice::getCurrentBufferSizeSamples() on the supplied pointer.

Parameters
devicethe audio IO device that will be used to drive the callback. Note that if you're going to store this this pointer, it is only valid until the next time that audioDeviceStopped is called.

Implements juce::AudioIODeviceCallback.

References juce::AudioIODeviceCallback::audioDeviceAboutToStart(), juce::BigInteger::countNumberOfSetBits(), juce::AudioIODevice::getActiveInputChannels(), juce::AudioIODevice::getActiveOutputChannels(), juce::AudioIODevice::getCurrentBufferSizeSamples(), inner, maximumSize, storedInputChannels, and storedOutputChannels.

◆ audioDeviceError()

virtual void juce::AudioIODeviceCallback::audioDeviceError ( const String errorMessage)
virtualinherited

This can be overridden to be told if the device generates an error while operating.

Be aware that this could be called by any thread! And not all devices perform this callback.

Reimplemented in juce::SoundPlayer.

◆ audioDeviceIOCallback()

void juce::StandalonePluginHolder::CallbackMaxSizeEnforcer::audioDeviceIOCallback ( const float **  inputChannelData,
int  numInputChannels,
float **  outputChannelData,
int  numOutputChannels,
int  numSamples 
)
inlineoverridevirtual

Processes a block of incoming and outgoing audio data.

The subclass's implementation should use the incoming audio for whatever purposes it needs to, and must fill all the output channels with the next block of output data before returning.

The channel data is arranged with the same array indices as the channel name array returned by AudioIODevice::getOutputChannelNames(), but those channels that aren't specified in AudioIODevice::open() will have a null pointer for their associated channel, so remember to check for this.

Parameters
inputChannelDataa set of arrays containing the audio data for each incoming channel - this data is valid until the function returns. There will be one channel of data for each input channel that was enabled when the audio device was opened (see AudioIODevice::open())
numInputChannelsthe number of pointers to channel data in the inputChannelData array.
outputChannelDataa set of arrays which need to be filled with the data that should be sent to each outgoing channel of the device. There will be one channel of data for each output channel that was enabled when the audio device was opened (see AudioIODevice::open()) The initial contents of the array is undefined, so the callback function must fill all the channels with zeros if its output is silence. Failing to do this could cause quite an unpleasant noise!
numOutputChannelsthe number of pointers to channel data in the outputChannelData array.
numSamplesthe number of samples in each channel of the input and output arrays. The number of samples will depend on the audio device's buffer size and will usually remain constant, although this isn't guaranteed. For example, on Android, on devices which support it, Android will chop up your audio processing into several smaller callbacks to ensure higher audio performance. So make sure your code can cope with reasonable changes in the buffer size from one callback to the next.

Implements juce::AudioIODeviceCallback.

References juce::AudioIODeviceCallback::audioDeviceIOCallback(), initChannelPointers(), inner, jassertquiet, juce::jmin(), maximumSize, storedInputChannels, and storedOutputChannels.

◆ audioDeviceStopped()

void juce::StandalonePluginHolder::CallbackMaxSizeEnforcer::audioDeviceStopped ( )
inlineoverridevirtual

Called to indicate that the device has stopped.

Implements juce::AudioIODeviceCallback.

References juce::AudioIODeviceCallback::audioDeviceStopped(), and inner.

◆ initChannelPointers()

template<typename Ptr , typename Vector >
void juce::StandalonePluginHolder::CallbackMaxSizeEnforcer::initChannelPointers ( Ptr &&  source,
Vector &&  target,
int  offset 
)
inlineprivate

Member Data Documentation

◆ inner

AudioIODeviceCallback& juce::StandalonePluginHolder::CallbackMaxSizeEnforcer::inner
private

◆ maximumSize

int juce::StandalonePluginHolder::CallbackMaxSizeEnforcer::maximumSize = 0
private

◆ storedInputChannels

std::vector<const float*> juce::StandalonePluginHolder::CallbackMaxSizeEnforcer::storedInputChannels
private

◆ storedOutputChannels

std::vector<float*> juce::StandalonePluginHolder::CallbackMaxSizeEnforcer::storedOutputChannels
private

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