AudioPluginInstance Class Referenceabstract
juce_audio_processors » processors

Base class for an active instance of a plugin. More...

Inheritance diagram for AudioPluginInstance:

## Classes

struct | Parameter
| Structure used to describe plugin parameters. More...

## Public Member Functions

| ~AudioPluginInstance () override=default
| Destructor. More...
virtual void | fillInPluginDescription (PluginDescription &) const =0
| Fills-in the appropriate parts of this plugin description object. More...
PluginDescription | getPluginDescription () const
| Returns a PluginDescription for this plugin. More...
virtual void * | getPlatformSpecificData ()
| Returns a pointer to some kind of platform-specific data about the plugin. More...
| JUCE_DEPRECATED (String getParameterID(int index) override)
| JUCE_DEPRECATED (float getParameter(int parameterIndex) override)
| JUCE_DEPRECATED (void setParameter(int parameterIndex, float newValue) override)
| JUCE_DEPRECATED (const String getParameterName(int parameterIndex) override)
| JUCE_DEPRECATED (String getParameterName(int parameterIndex, int maximumStringLength) override)
| JUCE_DEPRECATED (const String getParameterText(int parameterIndex) override)
| JUCE_DEPRECATED (String getParameterText(int parameterIndex, int maximumStringLength) override)
| JUCE_DEPRECATED (int getParameterNumSteps(int parameterIndex) override)
| JUCE_DEPRECATED (bool isParameterDiscrete(int parameterIndex) const override)
| JUCE_DEPRECATED (bool isParameterAutomatable(int parameterIndex) const override)
| JUCE_DEPRECATED (float getParameterDefaultValue(int parameterIndex) override)
| JUCE_DEPRECATED (String getParameterLabel(int parameterIndex) const override)
| JUCE_DEPRECATED (bool isParameterOrientationInverted(int parameterIndex) const override)
| JUCE_DEPRECATED (bool isMetaParameter(int parameterIndex) const override)
| JUCE_DEPRECATED (AudioProcessorParameter::Category getParameterCategory(int parameterIndex) const override)
Public Member Functions inherited from AudioProcessor
virtual | ~AudioProcessor ()
| Destructor. More...
virtual const String | getName () const =0
| Returns the name of this processor. More...
virtual StringArray | getAlternateDisplayNames () const
| Returns a list of alternative names to use for this processor. More...
virtual void | prepareToPlay (double sampleRate, int maximumExpectedSamplesPerBlock)=0
| Called before playback starts, to let the processor prepare itself. More...
virtual void | releaseResources ()=0
| Called after playback has stopped, to let the object free up any resources it no longer needs. More...
virtual void | memoryWarningReceived ()
| Called by the host to indicate that you should reduce your memory footprint. More...
virtual void | processBlock (AudioBuffer< float > &buffer, MidiBuffer &midiMessages)=0
| Renders the next block. More...
virtual void | processBlock (AudioBuffer< double > &buffer, MidiBuffer &midiMessages)
| Renders the next block. More...
virtual void | processBlockBypassed (AudioBuffer< float > &buffer, MidiBuffer &midiMessages)
| Renders the next block when the processor is being bypassed. More...
virtual void | processBlockBypassed (AudioBuffer< double > &buffer, MidiBuffer &midiMessages)
| Renders the next block when the processor is being bypassed. More...
int | getBusCount (bool isInput) const noexcept
| Returns the number of buses on the input or output side. More...
Bus * | getBus (bool isInput, int busIndex) noexcept
| Returns the audio bus with a given index and direction. More...
const Bus * | getBus (bool isInput, int busIndex) const noexcept
| Returns the audio bus with a given index and direction. More...
virtual bool | canAddBus (bool isInput) const
| Callback to query if a bus can currently be added. More...
virtual bool | canRemoveBus (bool isInput) const
| Callback to query if the last bus can currently be removed. More...
bool | addBus (bool isInput)
| Dynamically request an additional bus. More...
bool | removeBus (bool isInput)
| Dynamically remove the latest added bus. More...
bool | setBusesLayout (const BusesLayout &)
| Set the channel layouts of this audio processor. More...
bool | setBusesLayoutWithoutEnabling (const BusesLayout &)
| Set the channel layouts of this audio processor without changing the enablement state of the buses. More...
BusesLayout | getBusesLayout () const
| Provides the current channel layouts of this audio processor. More...
AudioChannelSet | getChannelLayoutOfBus (bool isInput, int busIndex) const noexcept
| Provides the channel layout of the bus with a given index and direction. More...
bool | setChannelLayoutOfBus (bool isInput, int busIndex, const AudioChannelSet &layout)
| Set the channel layout of the bus with a given index and direction. More...
int | getChannelCountOfBus (bool isInput, int busIndex) const noexcept
| Provides the number of channels of the bus with a given index and direction. More...
bool | enableAllBuses ()
| Enables all buses. More...
bool | disableNonMainBuses ()
| Disables all non-main buses (aux and sidechains). More...
int | getChannelIndexInProcessBlockBuffer (bool isInput, int busIndex, int channelIndex) const noexcept
| Returns the position of a bus's channels within the processBlock buffer. More...
int | getOffsetInBusBufferForAbsoluteChannelIndex (bool isInput, int absoluteChannelIndex, int &busIndex) const noexcept
| Returns the offset in a bus's buffer from an absolute channel index. More...
template<typename FloatType >
AudioBuffer< FloatType > | getBusBuffer (AudioBuffer< FloatType > &processBlockBuffer, bool isInput, int busIndex) const
| Returns an AudioBuffer containing a set of channel pointers for a specific bus. More...
bool | checkBusesLayoutSupported (const BusesLayout &) const
| Returns true if the Audio processor is likely to support a given layout. More...
virtual bool | supportsDoublePrecisionProcessing () const
| Returns true if the Audio processor supports double precision floating point processing. More...
ProcessingPrecision | getProcessingPrecision () const noexcept
| Returns the precision-mode of the processor. More...
bool | isUsingDoublePrecision () const noexcept
| Returns true if the current precision is set to doublePrecision. More...
void | setProcessingPrecision (ProcessingPrecision newPrecision) noexcept
| Changes the processing precision of the receiver. More...
AudioPlayHead * | getPlayHead () const noexcept
| Returns the current AudioPlayHead object that should be used to find out the state and position of the playhead. More...
int | getTotalNumInputChannels () const noexcept
| Returns the total number of input channels. More...
int | getTotalNumOutputChannels () const noexcept
| Returns the total number of output channels. More...
int | getMainBusNumInputChannels () const noexcept
| Returns the number of input channels on the main bus. More...
int | getMainBusNumOutputChannels () const noexcept
| Returns the number of output channels on the main bus. More...
template<size_t numLayouts>
BusesLayout | getNextBestLayoutInLayoutList (const BusesLayout &layouts, const short(&channelLayoutList)[numLayouts][2])
| Returns the next best layout which is contained in a channel layout map. More...
double | getSampleRate () const noexcept
| Returns the current sample rate. More...
int | getBlockSize () const noexcept
| Returns the current typical block size that is being used. More...
int | getLatencySamples () const noexcept
| This returns the number of samples delay that the processor imposes on the audio passing through it. More...
void | setLatencySamples (int newLatency)
| Your processor subclass should call this to set the number of samples delay that it introduces. More...
virtual double | getTailLengthSeconds () const =0
| Returns the length of the processor's tail, in seconds. More...
virtual bool | acceptsMidi () const =0
| Returns true if the processor wants MIDI messages. More...
virtual bool | producesMidi () const =0
| Returns true if the processor produces MIDI messages. More...
virtual bool | supportsMPE () const
| Returns true if the processor supports MPE. More...
virtual bool | isMidiEffect () const
| Returns true if this is a MIDI effect plug-in and does no audio processing. More...
const CriticalSection & | getCallbackLock () const noexcept
| This returns a critical section that will automatically be locked while the host is calling the processBlock() method. More...
void | suspendProcessing (bool shouldBeSuspended)
| Enables and disables the processing callback. More...
bool | isSuspended () const noexcept
| Returns true if processing is currently suspended. More...
virtual void | reset ()
| A plugin can override this to be told when it should reset any playing voices. More...
virtual AudioProcessorParameter * | getBypassParameter () const
| Returns the parameter that controls the AudioProcessor's bypass state. More...
bool | isNonRealtime () const noexcept
| Returns true if the processor is being run in an offline mode for rendering. More...
virtual void | setNonRealtime (bool isNonRealtime) noexcept
| Called by the host to tell this processor whether it's being used in a non-realtime capacity for offline rendering or bouncing. More...
virtual AudioProcessorEditor * | createEditor ()=0
| Creates the processor's GUI. More...
virtual bool | hasEditor () const =0
| Your processor subclass must override this and return true if it can create an editor component. More...
AudioProcessorEditor * | getActiveEditor () const noexcept
| Returns the active editor, if there is one. More...
AudioProcessorEditor * | createEditorIfNeeded ()
| Returns the active editor, or if there isn't one, it will create one. More...
void | updateHostDisplay ()
| The processor can call this when something (apart from a parameter value) has changed. More...
void | addParameter (AudioProcessorParameter *)
| Adds a parameter to the AudioProcessor. More...
void | addParameterGroup (std::unique_ptr< AudioProcessorParameterGroup >)
| Adds a group of parameters to the AudioProcessor. More...
const AudioProcessorParameterGroup & | getParameterTree () const
| Returns the group of parameters managed by this AudioProcessor. More...
void | setParameterTree (AudioProcessorParameterGroup &&newTree)
| Sets the group of parameters managed by this AudioProcessor. More...
virtual void | refreshParameterList ()
| A processor should implement this method so that the host can ask it to rebuild its parameter tree. More...
const Array< AudioProcessorParameter * > & | getParameters () const
| Returns a flat list of the parameters in the current tree. More...
virtual int | getNumPrograms ()=0
| Returns the number of preset programs the processor supports. More...
virtual int | getCurrentProgram ()=0
| Returns the number of the currently active program. More...
virtual void | setCurrentProgram (int index)=0
| Called by the host to change the current program. More...
virtual const String | getProgramName (int index)=0
| Must return the name of a given program. More...
virtual void | changeProgramName (int index, const String &newName)=0
| Called by the host to rename a program. More...
virtual void | getStateInformation (juce::MemoryBlock &destData)=0
| The host will call this method when it wants to save the processor's internal state. More...
virtual void | getCurrentProgramStateInformation (juce::MemoryBlock &destData)
| The host will call this method if it wants to save the state of just the processor's current program. More...
virtual void | setStateInformation (const void *data, int sizeInBytes)=0
| This must restore the processor's state from a block of data previously created using getStateInformation(). More...
virtual void | setCurrentProgramStateInformation (const void *data, int sizeInBytes)
| The host will call this method if it wants to restore the state of just the processor's current program. More...
virtual void | numChannelsChanged ()
| This method is called when the total number of input or output channels is changed. More...
virtual void | numBusesChanged ()
| This method is called when the number of buses is changed. More...
virtual void | processorLayoutsChanged ()
| This method is called when the layout of the audio processor changes. More...
virtual String | getStateInformationString ()
| LV2 specific calls, saving/restore as string. More...
virtual void | setStateInformationString (const String &)
virtual void | addListener (AudioProcessorListener *newListener)
| Adds a listener that will be called when an aspect of this processor changes. More...
virtual void | removeListener (AudioProcessorListener *listenerToRemove)
| Removes a previously added listener. More...
virtual void | setPlayHead (AudioPlayHead *newPlayHead)
| Tells the processor to use this playhead object. More...
void | setPlayConfigDetails (int numIns, int numOuts, double sampleRate, int blockSize)
| This is called by the processor to specify its details before being played. More...
void | setRateAndBufferSizeDetails (double sampleRate, int blockSize) noexcept
| This is called by the processor to specify its details before being played. More...
virtual int32 | getAAXPluginIDForMainBusConfig (const AudioChannelSet &mainInputLayout, const AudioChannelSet &mainOutputLayout, bool idForAudioSuite) const
| AAX plug-ins need to report a unique "plug-in id" for every audio layout configuration that your AudioProcessor supports on the main bus. More...
virtual CurveData | getResponseCurve (CurveData::Type) const
void | editorBeingDeleted (AudioProcessorEditor *) noexcept
| Not for public use - this is called before deleting an editor component. More...
virtual void | updateTrackProperties (const TrackProperties &properties)
| Informs the AudioProcessor that track properties such as the track's name or colour has been changed. More...

## Protected Member Functions

| AudioPluginInstance ()=default
| AudioPluginInstance (const BusesProperties &ioLayouts)
template<size_t numLayouts>
| AudioPluginInstance (const short channelLayoutList[numLayouts][2])
Protected Member Functions inherited from AudioProcessor
| AudioProcessor ()
| Constructor. More...
| AudioProcessor (const BusesProperties &ioLayouts)
| Constructor for multi-bus AudioProcessors. More...
| AudioProcessor (const std::initializer_list< const short[2]> &channelLayoutList)
| Constructor for AudioProcessors which use layout maps If your AudioProcessor uses layout maps then use this constructor. More...
virtual bool | isBusesLayoutSupported (const BusesLayout &) const
| Callback to query if the AudioProcessor supports a specific layout. More...
virtual bool | canApplyBusesLayout (const BusesLayout &layouts) const
| Callback to check if a certain bus layout can now be applied. More...
virtual bool | applyBusLayouts (const BusesLayout &layouts)
| This method will be called when a new bus layout needs to be applied. More...
virtual bool | canApplyBusCountChange (bool isInput, bool isAddingBuses, BusProperties &outNewBusProperties)
| Callback to query if adding/removing buses currently possible. More...
void | sendParamChangeMessageToListeners (int parameterIndex, float newValue)

## Additional Inherited Members

Public Types inherited from AudioProcessor
enum | ProcessingPrecision { singlePrecision, doublePrecision }
enum | WrapperType { wrapperType_Undefined = 0, wrapperType_VST, wrapperType_VST3, wrapperType_AudioUnit, wrapperType_AudioUnitv3, wrapperType_RTAS, wrapperType_AAX, wrapperType_Standalone, wrapperType_Unity, wrapperType_LV2 }
| Flags to indicate the type of plugin context in which a processor is being used. More...
Static Public Member Functions inherited from AudioProcessor
static bool | containsLayout (const BusesLayout &layouts, const std::initializer_list< const short[2]> &channelLayoutList)
| Returns true if the channel layout map contains a certain layout. More...
template<size_t numLayouts>
static bool | containsLayout (const BusesLayout &layouts, const short(&channelLayoutList)[numLayouts][2])
static int | getDefaultNumParameterSteps () noexcept
| Returns the default number of steps for a parameter. More...
static const char * | getWrapperTypeDescription (AudioProcessor::WrapperType) noexcept
| Returns a textual description of a WrapperType value. More...
static void | copyXmlToBinary (const XmlElement &xml, juce::MemoryBlock &destData)
| Helper function that just converts an xml element into a binary blob. More...
static std::unique_ptr< XmlElement > | getXmlFromBinary (const void *data, int sizeInBytes)
| Retrieves an XML element that was stored as binary with the copyXmlToBinary() method. More...
static void JUCE_CALLTYPE | setTypeOfNextNewPlugin (WrapperType)
Public Attributes inherited from AudioProcessor
WrapperType | wrapperType
| When loaded by a plugin wrapper, this flag will be set to indicate the type of plugin within which the processor is running. More...
Protected Attributes inherited from AudioProcessor
std::atomic< AudioPlayHead * > | playHead { nullptr }

## Detailed Description

Base class for an active instance of a plugin.

This derives from the AudioProcessor class, and adds some extra functionality that helps when wrapping dynamically loaded plugins.

This class is not needed when writing plugins, and you should never need to derive your own sub-classes from it. The plugin hosting classes use it internally and will return AudioPluginInstance objects which wrap external plugins.

See also
  AudioProcessor, AudioPluginFormat

## Constructor & Destructor Documentation

## ~AudioPluginInstance()

AudioPluginInstance::~AudioPluginInstance | ( |  | ) |

override default

Destructor.

Make sure that you delete any UI components that belong to this plugin before deleting the plugin.

## AudioPluginInstance() [1/3]

AudioPluginInstance::AudioPluginInstance | ( |  | ) |

protected default

## AudioPluginInstance() [2/3]

AudioPluginInstance::AudioPluginInstance | ( | const BusesProperties & | ioLayouts | ) |

protected

## AudioPluginInstance() [3/3]

template<size_t numLayouts>

AudioPluginInstance::AudioPluginInstance | ( | const short | channelLayoutList[numLayouts][2] | ) |

protected

## Member Function Documentation

## fillInPluginDescription()

virtual void AudioPluginInstance::fillInPluginDescription | ( | PluginDescription & |  | ) | const

pure virtual

Fills-in the appropriate parts of this plugin description object.

Implemented in AudioProcessorGraph::AudioGraphIOProcessor.

## getPluginDescription()

PluginDescription AudioPluginInstance::getPluginDescription | ( |  | ) | const

Returns a PluginDescription for this plugin.

This is just a convenience method to avoid calling fillInPluginDescription.

## getPlatformSpecificData()

virtual void* AudioPluginInstance::getPlatformSpecificData | ( |  | ) |

virtual

Returns a pointer to some kind of platform-specific data about the plugin.

E.g. For a VST, this value can be cast to an AEffect*. For an AudioUnit, it can be cast to an AudioUnit handle.

## JUCE_DEPRECATED() [1/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | String getParameterID(int index) | override | ) |

## JUCE_DEPRECATED() [2/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | float getParameter(int parameterIndex) | override | ) |

## JUCE_DEPRECATED() [3/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | void setParameter(int parameterIndex, float newValue) | override | ) |

## JUCE_DEPRECATED() [4/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | const String getParameterName(int parameterIndex) | override | ) |

## JUCE_DEPRECATED() [5/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | String getParameterName(int parameterIndex, int maximumStringLength) | override | ) |

## JUCE_DEPRECATED() [6/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | const String getParameterText(int parameterIndex) | override | ) |

## JUCE_DEPRECATED() [7/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | String getParameterText(int parameterIndex, int maximumStringLength) | override | ) |

## JUCE_DEPRECATED() [8/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | int getParameterNumSteps(int parameterIndex) | override | ) |

## JUCE_DEPRECATED() [9/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | bool isParameterDiscrete(int parameterIndex) const | override | ) |

## JUCE_DEPRECATED() [10/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | bool isParameterAutomatable(int parameterIndex) const | override | ) |

## JUCE_DEPRECATED() [11/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | float getParameterDefaultValue(int parameterIndex) | override | ) |

## JUCE_DEPRECATED() [12/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | String getParameterLabel(int parameterIndex) const | override | ) |

## JUCE_DEPRECATED() [13/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | bool isParameterOrientationInverted(int parameterIndex) const | override | ) |

## JUCE_DEPRECATED() [14/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | bool isMetaParameter(int parameterIndex) const | override | ) |

## JUCE_DEPRECATED() [15/15]

AudioPluginInstance::JUCE_DEPRECATED | ( | AudioProcessorParameter::Category getParameterCategory(int parameterIndex) const | override | ) |

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

- juce_AudioPluginInstance.h