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

Inheritance diagram for AudioPluginInstance:

Public Member Functions

virtual ~AudioPluginInstance ()
 Destructor. More...
 
virtual void fillInPluginDescription (PluginDescription &description) 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...
 
virtual void refreshParameterList ()
 For some formats (currently AudioUnit), this forces a reload of the list of available parameters. More...
 
- 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 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...
 
BusgetBus (bool isInput, int busIdx) noexcept
 Returns the audio bus with a given index and direction. More...
 
const BusgetBus (bool isInput, int busIdx) 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 busIdx, const AudioChannelSet &layout)
 Set the channel layout of the bus with a given index and direction. More...
 
int getChannelCountOfBus (bool isInput, int busIdx) 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 &busIdx) const noexcept
 Returns the offset in a bus's buffer from an absolute channel indes. 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...
 
AudioPlayHeadgetPlayHead () 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<int 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 CriticalSectiongetCallbackLock () 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...
 
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 AudioProcessorEditorcreateEditor ()=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...
 
AudioProcessorEditorgetActiveEditor () const noexcept
 Returns the active editor, if there is one. More...
 
AudioProcessorEditorcreateEditorIfNeeded ()
 Returns the active editor, or if there isn't one, it will create one. More...
 
virtual int getNumParameters ()
 This must return the correct value immediately after the object has been created, and mustn't change the number of parameters later. More...
 
virtual const String getParameterName (int parameterIndex)
 Returns the name of a particular parameter. More...
 
virtual String getParameterID (int index)
 Returns the ID of a particular parameter. More...
 
virtual float getParameter (int parameterIndex)
 Called by the host to find out the value of one of the processor's parameters. More...
 
virtual String getParameterName (int parameterIndex, int maximumStringLength)
 Returns the name of a parameter as a text string with a preferred maximum length. More...
 
virtual const String getParameterText (int parameterIndex)
 Returns the value of a parameter as a text string. More...
 
virtual String getParameterText (int parameterIndex, int maximumStringLength)
 Returns the value of a parameter as a text string with a preferred maximum length. More...
 
virtual int getParameterNumSteps (int parameterIndex)
 Returns the number of discrete steps that this parameter can represent. More...
 
virtual bool isParameterDiscrete (int parameterIndex) const
 Returns true if the parameter should take discrete, rather than continuous values. More...
 
virtual float getParameterDefaultValue (int parameterIndex)
 Returns the default value for the parameter. More...
 
virtual String getParameterLabel (int index) const
 Some plugin types may be able to return a label string for a parameter's units. More...
 
virtual bool isParameterOrientationInverted (int index) const
 This can be overridden to tell the host that particular parameters operate in the reverse direction. More...
 
virtual void setParameter (int parameterIndex, float newValue)
 The host will call this method to change the value of one of the processor's parameters. More...
 
void setParameterNotifyingHost (int parameterIndex, float newValue)
 Your processor can call this when it needs to change one of its parameters. More...
 
virtual bool isParameterAutomatable (int parameterIndex) const
 Returns true if the host can automate this parameter. More...
 
virtual bool isMetaParameter (int parameterIndex) const
 Should return true if this parameter is a "meta" parameter. More...
 
virtual AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const
 Should return the parameter's category. More...
 
void beginParameterChangeGesture (int parameterIndex)
 Sends a signal to the host to tell it that the user is about to start changing this parameter. More...
 
void endParameterChangeGesture (int parameterIndex)
 Tells the host that the user has finished changing this parameter. 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 list. More...
 
const OwnedArray< AudioProcessorParameter > & getParameters () const noexcept
 Returns the current list of parameters. 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 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...
 
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 ()
 
 AudioPluginInstance (const BusesProperties &ioLayouts)
 
template<int numLayouts>
 AudioPluginInstance (const short channelLayoutList[numLayouts][2])
 
- Protected Member Functions inherited from AudioProcessor
 AudioProcessor ()
 Constructor. More...
 
 AudioProcessor (const BusesProperties &ioLayouts)
 Constructor for multibus AudioProcessors. More...
 
 AudioProcessor (const std::initializer_list< const short[2]> &channelLayoutList)
 Constructor for AudioProcessors which use layout maps. 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 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
}
 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<int 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 void copyXmlToBinary (const XmlElement &xml, juce::MemoryBlock &destData)
 Helper function that just converts an xml element into a binary blob. More...
 
static XmlElementgetXmlFromBinary (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
AudioPlayHeadplayHead
 

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()

virtual AudioPluginInstance::~AudioPluginInstance ( )
virtual

Destructor.

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

◆ AudioPluginInstance() [1/3]

AudioPluginInstance::AudioPluginInstance ( )
protected

◆ AudioPluginInstance() [2/3]

AudioPluginInstance::AudioPluginInstance ( const BusesProperties ioLayouts)
protected

◆ AudioPluginInstance() [3/3]

template<int numLayouts>
AudioPluginInstance::AudioPluginInstance ( const short  channelLayoutList[numLayouts][2])
protected

Member Function Documentation

◆ fillInPluginDescription()

virtual void AudioPluginInstance::fillInPluginDescription ( PluginDescription description) const
pure virtual

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

Implemented in AudioProcessorGraph::AudioGraphIOProcessor.

Referenced by AudioProcessorGraph::AudioGraphIOProcessor::getParentGraph().

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

◆ refreshParameterList()

virtual void AudioPluginInstance::refreshParameterList ( )
virtual

For some formats (currently AudioUnit), this forces a reload of the list of available parameters.


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