Loading...
Searching...
No Matches
juce::AudioPluginInstance Class Referenceabstract

## 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

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

- juce_audio_processors_headless/processors/juce_AudioPluginInstance.h

Inheritance diagram for juce::AudioPluginInstance:

## Classes

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

## Public Types

using | HostedParameter = HostedAudioProcessorParameter
Public Types inherited from juce::AudioProcessor
enum | ProcessingPrecision { singlePrecision , doublePrecision }
enum class | Realtime { no , yes }
enum | WrapperType { wrapperType_Undefined = 0 , wrapperType_VST , wrapperType_VST3 , wrapperType_AudioUnit , wrapperType_AudioUnitv3 , wrapperType_AAX , wrapperType_Standalone , wrapperType_Unity , wrapperType_LV2 }
| Flags to indicate the type of plugin context in which a processor is being used. More...
using | ChangeDetails = AudioProcessorListener::ChangeDetails

## Public Member Functions

| ~AudioPluginInstance () override=default
| Destructor.
virtual void | fillInPluginDescription (PluginDescription &) const =0
| Fills-in the appropriate parts of this plugin description object.
PluginDescription | getPluginDescription () const
| Returns a PluginDescription for this plugin.
void | getExtensions (class ExtensionsVisitor &) const =delete
| Obsolete: Prefer to use getVSTClient(), getVST3Client(), getAudioUnitClient(), and/or getARAClient().
virtual AudioPluginExtensions::ARAClient * | getARAClient ()
| Returns ARA-specific extensions, or nullptr if extensions are unavailable.
virtual const AudioPluginExtensions::ARAClient * | getARAClient () const
| Returns ARA-specific extensions, or nullptr if extensions are unavailable.
virtual AudioPluginExtensions::AudioUnitClient * | getAudioUnitClient ()
| Returns AU-specific extensions, or nullptr if extensions are unavailable.
virtual const AudioPluginExtensions::AudioUnitClient * | getAudioUnitClient () const
| Returns AU-specific extensions, or nullptr if extensions are unavailable.
virtual AudioPluginExtensions::VSTClient * | getVSTClient ()
| Returns VST-specific extensions, or nullptr if extensions are unavailable.
virtual const AudioPluginExtensions::VSTClient * | getVSTClient () const
| Returns VST-specific extensions, or nullptr if extensions are unavailable.
virtual AudioPluginExtensions::VST3Client * | getVST3Client ()
| Returns VST3-specific extensions, or nullptr if extensions are unavailable.
virtual const AudioPluginExtensions::VST3Client * | getVST3Client () const
| Returns VST3-specific extensions, or nullptr if extensions are unavailable.
void | addHostedParameter (std::unique_ptr< HostedParameter >)
| Adds a parameter to this instance.
void | addHostedParameterGroup (std::unique_ptr< AudioProcessorParameterGroup >)
| Adds multiple parameters to this instance.
void | setHostedParameterTree (AudioProcessorParameterGroup)
| Adds multiple parameters to this instance.
HostedParameter * | getHostedParameter (int index) const
| Gets the parameter at a particular index.
Public Member Functions inherited from juce::AudioProcessor
virtual | ~AudioProcessor ()
| Destructor.
virtual const String | getName () const =0
| Returns the name of this processor.
virtual StringArray | getAlternateDisplayNames () const
| Returns a list of alternative names to use for this processor.
virtual void | prepareToPlay (double sampleRate, int maximumExpectedSamplesPerBlock)=0
| Called before playback starts, to let the processor prepare itself.
virtual void | releaseResources ()=0
| Called after playback has stopped, to let the object free up any resources it no longer needs.
virtual void | memoryWarningReceived ()
| Called by the host to indicate that you should reduce your memory footprint.
virtual void | processBlock (AudioBuffer< float > &buffer, MidiBuffer &midiMessages)=0
| Renders the next block.
virtual void | processBlock (AudioBuffer< double > &buffer, MidiBuffer &midiMessages)
| Renders the next block.
virtual void | processBlockBypassed (AudioBuffer< float > &buffer, MidiBuffer &midiMessages)
| Renders the next block when the processor is being bypassed.
virtual void | processBlockBypassed (AudioBuffer< double > &buffer, MidiBuffer &midiMessages)
| Renders the next block when the processor is being bypassed.
int | getBusCount (bool isInput) const noexcept
| Returns the number of buses on the input or output side.
Bus * | getBus (bool isInput, int busIndex) noexcept
| Returns the audio bus with a given index and direction.
const Bus * | getBus (bool isInput, int busIndex) const noexcept
| Returns the audio bus with a given index and direction.
virtual bool | canAddBus (bool isInput) const
| Callback to query if a bus can currently be added.
virtual bool | canRemoveBus (bool isInput) const
| Callback to query if the last bus can currently be removed.
bool | addBus (bool isInput)
| Dynamically request an additional bus.
bool | removeBus (bool isInput)
| Dynamically remove the latest added bus.
bool | setBusesLayout (const BusesLayout &)
| Set the channel layouts of this audio processor.
bool | setBusesLayoutWithoutEnabling (const BusesLayout &)
| Set the channel layouts of this audio processor without changing the enablement state of the buses.
BusesLayout | getBusesLayout () const
| Provides the current channel layouts of this audio processor.
AudioChannelSet | getChannelLayoutOfBus (bool isInput, int busIndex) const noexcept
| Provides the channel layout of the bus with a given index and direction.
bool | setChannelLayoutOfBus (bool isInput, int busIndex, const AudioChannelSet &layout)
| Set the channel layout of the bus with a given index and direction.
int | getChannelCountOfBus (bool isInput, int busIndex) const noexcept
| Provides the number of channels of the bus with a given index and direction.
bool | enableAllBuses ()
| Enables all buses.
bool | disableNonMainBuses ()
| Disables all non-main buses (aux and sidechains).
int | getChannelIndexInProcessBlockBuffer (bool isInput, int busIndex, int channelIndex) const noexcept
| Returns the position of a bus's channels within the processBlock buffer.
int | getOffsetInBusBufferForAbsoluteChannelIndex (bool isInput, int absoluteChannelIndex, int &busIndex) const noexcept
| Returns the offset in a bus's buffer from an absolute channel index.
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.
bool | checkBusesLayoutSupported (const BusesLayout &) const
| Returns true if the Audio processor is likely to support a given layout.
virtual bool | supportsDoublePrecisionProcessing () const
| Returns true if the Audio processor supports double precision floating point processing.
ProcessingPrecision | getProcessingPrecision () const noexcept
| Returns the precision-mode of the processor.
bool | isUsingDoublePrecision () const noexcept
| Returns true if the current precision is set to doublePrecision.
void | setProcessingPrecision (ProcessingPrecision newPrecision) noexcept
| Changes the processing precision of the receiver.
AudioPlayHead * | getPlayHead () const noexcept
| Returns the current AudioPlayHead object that should be used to find out the state and position of the playhead.
int | getTotalNumInputChannels () const noexcept
| Returns the total number of input channels.
int | getTotalNumOutputChannels () const noexcept
| Returns the total number of output channels.
int | getMainBusNumInputChannels () const noexcept
| Returns the number of input channels on the main bus.
int | getMainBusNumOutputChannels () const noexcept
| Returns the number of output channels on the main bus.
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.
double | getSampleRate () const noexcept
| Returns the current sample rate.
int | getBlockSize () const noexcept
| Returns the current typical block size that is being used.
int | getLatencySamples () const noexcept
| This returns the number of samples delay that the processor imposes on the audio passing through it.
void | setLatencySamples (int newLatency)
| Your processor subclass should call this to set the number of samples delay that it introduces.
virtual double | getTailLengthSeconds () const =0
| Returns the length of the processor's tail, in seconds.
virtual bool | acceptsMidi () const =0
| Returns true if the processor wants MIDI messages.
virtual bool | producesMidi () const =0
| Returns true if the processor produces MIDI messages.
virtual bool | supportsMPE () const
| Returns true if the processor supports MPE.
virtual bool | isMidiEffect () const
| Returns true if this is a MIDI effect plug-in and does no audio processing.
const CriticalSection & | getCallbackLock () const noexcept
| This returns a critical section that will automatically be locked while the host is calling the processBlock() method.
void | suspendProcessing (bool shouldBeSuspended)
| Enables and disables the processing callback.
bool | isSuspended () const noexcept
| Returns true if processing is currently suspended.
virtual void | reset ()
| A plugin can override this to be told when it should reset any playing voices.
virtual AudioProcessorParameter * | getBypassParameter () const
| Returns the parameter that controls the AudioProcessor's bypass state.
bool | isNonRealtime () const noexcept
| Returns true if the processor is being run in an offline mode for rendering.
Realtime | isRealtime () const noexcept
| Returns no if the processor is being run in an offline mode for rendering.
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.
virtual bool | hasEditor () const =0
| Your processor subclass must override this and return true if it can create an editor component.
AudioProcessorEditor * | getActiveEditor () const noexcept
| Returns the active editor, if there is one.
AudioProcessorEditor * | createEditorAndMakeActive ()
| If there's no active editor, creates a new editor and stores it as the active editor before returning it.
AudioProcessorEditor * | createEditorIfNeeded ()
void | updateHostDisplay (const ChangeDetails &details=ChangeDetails::getDefaultFlags())
| The processor can call this when something (apart from a parameter value) has changed.
void | addParameter (AudioProcessorParameter *)
| Adds a parameter to the AudioProcessor.
void | addParameterGroup (std::unique_ptr< AudioProcessorParameterGroup >)
| Adds a group of parameters to the AudioProcessor.
const AudioProcessorParameterGroup & | getParameterTree () const
| Returns the group of parameters managed by this AudioProcessor.
void | setParameterTree (AudioProcessorParameterGroup &&newTree)
| Sets the group of parameters managed by this AudioProcessor.
virtual void | refreshParameterList ()
| A processor should implement this method so that the host can ask it to rebuild its parameter tree.
const Array< AudioProcessorParameter * > & | getParameters () const
| Returns a flat list of the parameters in the current tree.
virtual int | getNumPrograms ()=0
| Returns the number of preset programs the processor supports.
virtual int | getCurrentProgram ()=0
| Returns the number of the currently active program.
virtual void | setCurrentProgram (int index)=0
| Called by the host to change the current program.
virtual const String | getProgramName (int index)=0
| Must return the name of a given program.
virtual void | changeProgramName (int index, const String &newName)=0
| Called by the host to rename a program.
virtual void | getStateInformation (MemoryBlock &destData)=0
| The host will call this method when it wants to save the processor's internal state.
virtual void | getCurrentProgramStateInformation (MemoryBlock &destData)
| The host will call this method if it wants to save the state of just the processor's current program.
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().
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.
virtual void | numChannelsChanged ()
| This method is called when the total number of input or output channels is changed.
virtual void | numBusesChanged ()
| This method is called when the number of buses is changed.
virtual void | processorLayoutsChanged ()
| This method is called when the layout of the audio processor changes.
virtual void | addListener (AudioProcessorListener *newListener)
| Adds a listener that will be called when an aspect of this processor changes.
virtual void | removeListener (AudioProcessorListener *listenerToRemove)
| Removes a previously added listener.
virtual void | setPlayHead (AudioPlayHead *newPlayHead)
| Tells the processor to use this playhead object.
void | setPlayConfigDetails (int numIns, int numOuts, double sampleRate, int blockSize)
| This is called by the processor to specify its details before being played.
void | setRateAndBufferSizeDetails (double sampleRate, int blockSize) noexcept
| This is called by the processor to specify its details before being played.
virtual void | audioWorkgroupContextChanged (const AudioWorkgroup &workgroup)
| This is called by the host when the thread workgroup context has changed.
virtual AAXClientExtensions & | getAAXClientExtensions ()
| Returns a reference to an object that implements AAX specific information regarding this AudioProcessor.
virtual VST2ClientExtensions * | getVST2ClientExtensions ()
| Returns a non-owning pointer to an object that implements VST2 specific information regarding this AudioProcessor.
virtual VST3ClientExtensions * | getVST3ClientExtensions ()
| Returns a non-owning pointer to an object that implements VST3 specific information regarding this AudioProcessor.
virtual AudioProcessorARAExtension * | getARAClientExtensions ()
| Returns a non-owning pointer to an object that implements ARA specific information regarding this AudioProcessor.
virtual CurveData | getResponseCurve (CurveData::Type) const
void | editorBeingDeleted (AudioProcessorEditor *) noexcept
| Not for public use - this is called before deleting an editor component.
virtual void | updateTrackProperties (const TrackProperties &properties)
| Informs the AudioProcessor that track properties such as the track's name or colour has been changed.
virtual std::optional< String > | getNameForMidiNoteNumber (int note, int midiChannel)
| Returns a custom name for a MIDI note number.

## Protected Member Functions

| AudioProcessor ()
| Constructor.
| AudioProcessor (const BusesProperties &ioLayouts)
| Constructor for multi-bus AudioProcessors.
| 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.
Protected Member Functions inherited from juce::AudioProcessor
| AudioProcessor ()
| Constructor.
| AudioProcessor (const BusesProperties &ioLayouts)
| Constructor for multi-bus AudioProcessors.
| 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.
virtual bool | isBusesLayoutSupported (const BusesLayout &) const
| Callback to query if the AudioProcessor supports a specific layout.
virtual bool | canApplyBusesLayout (const BusesLayout &layouts) const
| Callback to check if a certain bus layout can now be applied.
virtual bool | applyBusLayouts (const BusesLayout &layouts)
| This method will be called when a new bus layout needs to be applied.
virtual bool | canApplyBusCountChange (bool isInput, bool isAddingBuses, BusProperties &outNewBusProperties)
| Callback to query if adding/removing buses currently possible.

## Additional Inherited Members

Static Public Member Functions inherited from juce::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.
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.
static const char * | getWrapperTypeDescription (AudioProcessor::WrapperType) noexcept
| Returns a textual description of a WrapperType value.
static void | copyXmlToBinary (const XmlElement &xml, MemoryBlock &destData)
| Helper function that just converts an xml element into a binary blob.
static std::unique_ptr< XmlElement > | getXmlFromBinary (const void *data, int sizeInBytes)
| Retrieves an XML element that was stored as binary with the copyXmlToBinary() method.
static void JUCE_CALLTYPE | setTypeOfNextNewPlugin (WrapperType)
Public Attributes inherited from juce::AudioProcessor
const 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.
Protected Attributes inherited from juce::AudioProcessor
std::atomic< AudioPlayHead * > | playHead { nullptr }

## Member Typedef Documentation

## HostedParameter

using juce::AudioPluginInstance::HostedParameter = HostedAudioProcessorParameter

## Constructors and Destructors

## ~AudioPluginInstance()

juce::AudioPluginInstance::~AudioPluginInstance | ( |  | ) |

override default

Destructor.

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

## Member Functions

## fillInPluginDescription()

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

pure virtual

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

Implemented in juce::AudioProcessorGraph::AudioGraphIOProcessor.

## getPluginDescription()

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

Returns a PluginDescription for this plugin.

This is just a convenience method to avoid calling fillInPluginDescription.

## getExtensions()

void juce::AudioPluginInstance::getExtensions | ( | class ExtensionsVisitor & |  | ) | const

delete

Obsolete: Prefer to use getVSTClient(), getVST3Client(), getAudioUnitClient(), and/or getARAClient().

## getARAClient() [1/2]

virtual AudioPluginExtensions::ARAClient * juce::AudioPluginInstance::getARAClient | ( |  | ) |

inline virtual

Returns ARA-specific extensions, or nullptr if extensions are unavailable.

## getARAClient() [2/2]

virtual const AudioPluginExtensions::ARAClient * juce::AudioPluginInstance::getARAClient | ( |  | ) | const

inline virtual

Returns ARA-specific extensions, or nullptr if extensions are unavailable.

## getAudioUnitClient() [1/2]

virtual AudioPluginExtensions::AudioUnitClient * juce::AudioPluginInstance::getAudioUnitClient | ( |  | ) |

inline virtual

Returns AU-specific extensions, or nullptr if extensions are unavailable.

## getAudioUnitClient() [2/2]

virtual const AudioPluginExtensions::AudioUnitClient * juce::AudioPluginInstance::getAudioUnitClient | ( |  | ) | const

inline virtual

Returns AU-specific extensions, or nullptr if extensions are unavailable.

## getVSTClient() [1/2]

virtual AudioPluginExtensions::VSTClient * juce::AudioPluginInstance::getVSTClient | ( |  | ) |

inline virtual

Returns VST-specific extensions, or nullptr if extensions are unavailable.

## getVSTClient() [2/2]

virtual const AudioPluginExtensions::VSTClient * juce::AudioPluginInstance::getVSTClient | ( |  | ) | const

inline virtual

Returns VST-specific extensions, or nullptr if extensions are unavailable.

## getVST3Client() [1/2]

virtual AudioPluginExtensions::VST3Client * juce::AudioPluginInstance::getVST3Client | ( |  | ) |

inline virtual

Returns VST3-specific extensions, or nullptr if extensions are unavailable.

## getVST3Client() [2/2]

virtual const AudioPluginExtensions::VST3Client * juce::AudioPluginInstance::getVST3Client | ( |  | ) | const

inline virtual

Returns VST3-specific extensions, or nullptr if extensions are unavailable.

## addHostedParameter()

void juce::AudioPluginInstance::addHostedParameter | ( | std::unique_ptr< HostedParameter > |  | ) |

Adds a parameter to this instance.

See also
  AudioProcessor::addParameter()

## addHostedParameterGroup()

void juce::AudioPluginInstance::addHostedParameterGroup | ( | std::unique_ptr< AudioProcessorParameterGroup > |  | ) |

Adds multiple parameters to this instance.

In debug mode, this will also check that all added parameters derive from HostedParameter.

See also
  AudioProcessor::addParameterGroup()

## setHostedParameterTree()

void juce::AudioPluginInstance::setHostedParameterTree | ( | AudioProcessorParameterGroup |  | ) |

Adds multiple parameters to this instance.

In debug mode, this will also check that all added parameters derive from HostedParameter.

See also
  AudioProcessor::setParameterTree()

## getHostedParameter()

HostedParameter * juce::AudioPluginInstance::getHostedParameter | ( | int | index | ) | const

Gets the parameter at a particular index.

If you want to find lots of parameters by their IDs, you should probably build and use a map<String, HostedParameter*> by looping through all parameters.

## AudioProcessor() [1/3]

juce::AudioProcessor::AudioProcessor | ( |  | ) |

protected

Constructor.

This constructor will create a main input and output bus which are disabled by default. If you need more fine-grained control then use the other constructors.

## AudioProcessor() [2/3]

juce::AudioProcessor::AudioProcessor | ( | const BusesProperties & | ioLayouts | ) |

protected

Constructor for multi-bus AudioProcessors.

If your AudioProcessor supports multiple buses than use this constructor to initialise the bus layouts and bus names of your plug-in.

## AudioProcessor() [3/3]

juce::AudioProcessor::AudioProcessor | ( | const std::initializer_list< const short[2]> & | channelLayoutList | ) |

inline protected

Constructor for AudioProcessors which use layout maps If your AudioProcessor uses layout maps then use this constructor.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited