JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::AudioProcessorGraph Class Reference

A type of AudioProcessor which plays back a graph of other AudioProcessors. More...

#include <juce_AudioProcessorGraph.h>

Inheritance diagram for juce::AudioProcessorGraph:
Collaboration diagram for juce::AudioProcessorGraph:

Classes

class  AudioGraphIOProcessor
 A special type of AudioProcessor that can live inside an AudioProcessorGraph in order to use the audio that comes into and out of the graph itself. More...
 
struct  Connection
 Represents a connection between two channels of two nodes in an AudioProcessorGraph. More...
 
class  Node
 Represents one of the nodes, or processors, in an AudioProcessorGraph. More...
 
struct  NodeAndChannel
 Represents an input or output channel of a node in an AudioProcessorGraph. More...
 
struct  NodeID
 Each node in the graph has a UID of this type. More...
 

Public Types

enum  { midiChannelIndex = 0x1000 }
 A special index that represents the midi channel of a node. More...
 
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
}
 Flags to indicate the type of plugin context in which a processor is being used. More...
 

Public Member Functions

 AudioProcessorGraph ()
 Creates an empty graph. More...
 
 ~AudioProcessorGraph () override
 Destructor. More...
 
bool acceptsMidi () const override
 Returns true if the processor wants MIDI messages. More...
 
bool addBus (bool isInput)
 Dynamically request an additional bus. More...
 
void addChangeListener (ChangeListener *listener)
 Registers a listener to receive change callbacks from this broadcaster. More...
 
bool addConnection (const Connection &)
 Attempts to connect two specified channels of two nodes. More...
 
virtual void addListener (AudioProcessorListener *newListener)
 Adds a listener that will be called when an aspect of this processor changes. More...
 
Node::Ptr addNode (AudioProcessor *newProcessor, NodeID nodeId={})
 Adds a node to the graph. 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...
 
void beginParameterChangeGesture (int parameterIndex)
 Sends a signal to the host to tell it that the user is about to start changing this parameter. More...
 
virtual bool canAddBus (bool isInput) const
 Callback to query if a bus can currently be added. More...
 
bool canConnect (const Connection &) const
 Returns true if it would be legal to connect the specified points. More...
 
virtual bool canRemoveBus (bool isInput) const
 Callback to query if the last bus can currently be removed. More...
 
void changeProgramName (int, const String &) override
 Called by the host to rename a program. More...
 
bool checkBusesLayoutSupported (const BusesLayout &) const
 Returns true if the Audio processor is likely to support a given layout. More...
 
void clear ()
 Deletes all nodes and connections from this graph. More...
 
AudioProcessorEditorcreateEditor () override
 Creates the processor's GUI. More...
 
AudioProcessorEditorcreateEditorIfNeeded ()
 Returns the active editor, or if there isn't one, it will create one. More...
 
bool disableNonMainBuses ()
 Disables all non-main buses (aux and sidechains). More...
 
bool disconnectNode (NodeID)
 Removes all connections from the specified node. More...
 
void dispatchPendingMessages ()
 If a change message has been sent but not yet dispatched, this will call sendSynchronousChangeMessage() to make the callback immediately. More...
 
void editorBeingDeleted (AudioProcessorEditor *) noexcept
 Not for public use - this is called before deleting an editor component. More...
 
bool enableAllBuses ()
 Enables all buses. More...
 
void endParameterChangeGesture (int parameterIndex)
 Tells the host that the user has finished changing this parameter. 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...
 
AudioProcessorEditorgetActiveEditor () const noexcept
 Returns the active editor, if there is one. More...
 
virtual StringArray getAlternateDisplayNames () const
 Returns a list of alternative names to use for this processor. More...
 
int getBlockSize () const noexcept
 Returns the current typical block size that is being used. More...
 
BusgetBus (bool isInput, int busIndex) noexcept
 Returns the audio bus with a given index and direction. More...
 
const BusgetBus (bool isInput, int busIndex) const noexcept
 Returns the audio bus with a given index and direction. 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...
 
int getBusCount (bool isInput) const noexcept
 Returns the number of buses on the input or output side. More...
 
BusesLayout getBusesLayout () const
 Provides the current channel layouts of this audio processor. More...
 
virtual AudioProcessorParametergetBypassParameter () const
 Returns the parameter that controls the AudioProcessor's bypass state. More...
 
const CriticalSectiongetCallbackLock () const noexcept
 This returns a critical section that will automatically be locked while the host is calling the processBlock() method. More...
 
int getChannelCountOfBus (bool isInput, int busIndex) const noexcept
 Provides the number of channels of the bus with a given index and direction. More...
 
int getChannelIndexInProcessBlockBuffer (bool isInput, int busIndex, int channelIndex) const noexcept
 Returns the position of a bus's channels within the processBlock buffer. More...
 
AudioChannelSet getChannelLayoutOfBus (bool isInput, int busIndex) const noexcept
 Provides the channel layout of the bus with a given index and direction. More...
 
std::vector< ConnectiongetConnections () const
 Returns the list of connections in the graph. More...
 
int getCurrentProgram () override
 Returns the number of the currently active program. 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...
 
int getLatencySamples () const noexcept
 This returns the number of samples delay that the processor imposes on the audio passing through it. 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...
 
const String getName () const override
 Returns the name of this processor. 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...
 
Node::Ptr getNode (int index) const noexcept
 Returns a pointer to one of the nodes in the graph. More...
 
NodegetNodeForId (NodeID) const
 Searches the graph for a node with the given ID number and returns it. More...
 
const ReferenceCountedArray< Node > & getNodes () const noexcept
 Returns the array of nodes in the graph. More...
 
int getNumNodes () const noexcept
 Returns the number of nodes in the graph. 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...
 
int getNumPrograms () override
 Returns the number of preset programs the processor supports. More...
 
int getOffsetInBusBufferForAbsoluteChannelIndex (bool isInput, int absoluteChannelIndex, int &busIndex) const noexcept
 Returns the offset in a bus's buffer from an absolute channel indes. More...
 
virtual float getParameter (int parameterIndex)
 Called by the host to find out the value of one of the processor's parameters. More...
 
virtual AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const
 Should return the parameter's category. More...
 
virtual float getParameterDefaultValue (int parameterIndex)
 Returns the default value for the parameter. More...
 
virtual String getParameterID (int index)
 Returns the ID of a particular 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 const String getParameterName (int parameterIndex)
 Returns the name of a particular parameter. 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 int getParameterNumSteps (int parameterIndex)
 Returns the number of discrete steps that this parameter can represent. More...
 
const OwnedArray< AudioProcessorParameter > & getParameters () const noexcept
 Returns the current list of parameters. 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...
 
const AudioProcessorParameterGroupgetParameterTree ()
 Returns the group of parameters managed by this AudioProcessor. More...
 
AudioPlayHeadgetPlayHead () const noexcept
 Returns the current AudioPlayHead object that should be used to find out the state and position of the playhead. More...
 
ProcessingPrecision getProcessingPrecision () const noexcept
 Returns the precision-mode of the processor. More...
 
const String getProgramName (int) override
 Must return the name of a given program. More...
 
virtual CurveData getResponseCurve (CurveData::Type) const
 
double getSampleRate () const noexcept
 Returns the current sample rate. More...
 
void getStateInformation (juce::MemoryBlock &) override
 The host will call this method when it wants to save the processor's internal state. More...
 
double getTailLengthSeconds () const override
 Returns the length of the processor's tail, in seconds. 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...
 
bool hasEditor () const override
 Your processor subclass must override this and return true if it can create an editor component. More...
 
bool isAnInputTo (Node &source, Node &destination) const noexcept
 Does a recursive check to see if there's a direct or indirect series of connections between these two nodes. More...
 
bool isConnected (const Connection &) const noexcept
 Returns true if the given connection exists. More...
 
bool isConnected (NodeID possibleSourceNodeID, NodeID possibleDestNodeID) const noexcept
 Returns true if there is a direct connection between any of the channels of two specified nodes. More...
 
bool isConnectionLegal (const Connection &) const
 Returns true if the given connection's channel numbers map on to valid channels at each end. More...
 
virtual bool isMetaParameter (int parameterIndex) const
 Should return true if this parameter is a "meta" parameter. More...
 
virtual bool isMidiEffect () const
 Returns true if this is a MIDI effect plug-in and does no audio processing. More...
 
bool isNonRealtime () const noexcept
 Returns true if the processor is being run in an offline mode for rendering. More...
 
virtual bool isParameterAutomatable (int parameterIndex) const
 Returns true if the host can automate this parameter. More...
 
virtual bool isParameterDiscrete (int parameterIndex) const
 Returns true if the parameter should take discrete, rather than continuous values. More...
 
virtual bool isParameterOrientationInverted (int index) const
 This can be overridden to tell the host that particular parameters operate in the reverse direction. More...
 
bool isSuspended () const noexcept
 Returns true if processing is currently suspended. More...
 
bool isUsingDoublePrecision () const noexcept
 Returns true if the current precision is set to doublePrecision. More...
 
virtual void memoryWarningReceived ()
 Called by the host to indicate that you should reduce your memory footprint. More...
 
virtual void numBusesChanged ()
 This method is called when the number of buses is changed. More...
 
virtual void numChannelsChanged ()
 This method is called when the total number of input or output channels is changed. More...
 
void prepareToPlay (double, int) override
 Called before playback starts, to let the processor prepare itself. More...
 
void processBlock (AudioBuffer< float > &, MidiBuffer &) override
 Renders the next block. More...
 
void processBlock (AudioBuffer< double > &, MidiBuffer &) override
 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...
 
virtual void processorLayoutsChanged ()
 This method is called when the layout of the audio processor changes. More...
 
bool producesMidi () const override
 Returns true if the processor produces MIDI messages. More...
 
void releaseResources () override
 Called after playback has stopped, to let the object free up any resources it no longer needs. More...
 
void removeAllChangeListeners ()
 Removes all listeners from the list. More...
 
bool removeBus (bool isInput)
 Dynamically remove the latest added bus. More...
 
void removeChangeListener (ChangeListener *listener)
 Unregisters a listener from the list. More...
 
bool removeConnection (const Connection &)
 Deletes the given connection. More...
 
bool removeIllegalConnections ()
 Performs a sanity checks of all the connections. More...
 
virtual void removeListener (AudioProcessorListener *listenerToRemove)
 Removes a previously added listener. More...
 
bool removeNode (NodeID)
 Deletes a node within the graph which has the specified ID. More...
 
bool removeNode (Node *)
 Deletes a node within the graph. More...
 
void reset () override
 A plugin can override this to be told when it should reset any playing voices. More...
 
void sendChangeMessage ()
 Causes an asynchronous change message to be sent to all the registered listeners. More...
 
void sendSynchronousChangeMessage ()
 Sends a synchronous change message to all the registered listeners. 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...
 
bool setChannelLayoutOfBus (bool isInput, int busIndex, const AudioChannelSet &layout)
 Set the channel layout of the bus with a given index and direction. More...
 
void setCurrentProgram (int) override
 Called by the host to change the current program. 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...
 
void setLatencySamples (int newLatency)
 Your processor subclass should call this to set the number of samples delay that it introduces. More...
 
void setNonRealtime (bool) noexcept override
 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 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...
 
void setPlayConfigDetails (int numIns, int numOuts, double sampleRate, int blockSize)
 This is called by the processor to specify its details before being played. More...
 
virtual void setPlayHead (AudioPlayHead *newPlayHead)
 Tells the processor to use this playhead object. More...
 
void setProcessingPrecision (ProcessingPrecision newPrecision) noexcept
 Changes the processing precision of the receiver. More...
 
void setRateAndBufferSizeDetails (double sampleRate, int blockSize) noexcept
 This is called by the processor to specify its details before being played. More...
 
void setStateInformation (const void *data, int sizeInBytes) override
 This must restore the processor's state from a block of data previously created using getStateInformation(). More...
 
bool supportsDoublePrecisionProcessing () const override
 Returns true if the Audio processor supports double precision floating point processing. More...
 
virtual bool supportsMPE () const
 Returns true if the processor supports MPE. More...
 
void suspendProcessing (bool shouldBeSuspended)
 Enables and disables the processing callback. More...
 
void updateHostDisplay ()
 The processor can call this when something (apart from a parameter value) has changed. 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...
 

Static Public Member Functions

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 void copyXmlToBinary (const XmlElement &xml, juce::MemoryBlock &destData)
 Helper function that just converts an xml element into a binary blob. More...
 
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 XmlElementgetXmlFromBinary (const void *data, int sizeInBytes)
 Retrieves an XML element that was stored as binary with the copyXmlToBinary() method. More...
 
static void setTypeOfNextNewPlugin (WrapperType)
 

Public Attributes

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 Member Functions

virtual bool canApplyBusCountChange (bool isInput, bool isAddingBuses, BusProperties &outNewBusProperties)
 Callback to query if adding/removing buses currently possible. More...
 
virtual bool canApplyBusesLayout (const BusesLayout &layouts) const
 Callback to check if a certain bus layout can now be applied. More...
 
virtual bool isBusesLayoutSupported (const BusesLayout &) const
 Callback to query if the AudioProcessor supports a specific layout. More...
 
void sendParamChangeMessageToListeners (int parameterIndex, float newValue)
 

Protected Attributes

AudioPlayHeadplayHead = nullptr
 

Private Member Functions

bool anyNodesNeedPreparing () const noexcept
 
void buildRenderingSequence ()
 
void cancelPendingUpdate () noexcept
 This will stop any pending updates from happening. More...
 
bool canConnect (Node *src, int sourceChannel, Node *dest, int destChannel) const noexcept
 
void clearRenderingSequence ()
 
void handleAsyncUpdate () override
 Called back to do whatever your class needs to do. More...
 
void handleUpdateNowIfNeeded ()
 If an update has been triggered and is pending, this will invoke it synchronously. More...
 
bool isAnInputTo (Node &src, Node &dst, int recursionCheck) const noexcept
 
bool isConnected (Node *src, int sourceChannel, Node *dest, int destChannel) const noexcept
 
bool isLegal (Node *src, int sourceChannel, Node *dest, int destChannel) const noexcept
 
bool isUpdatePending () const noexcept
 Returns true if there's an update callback in the pipeline. More...
 
void topologyChanged ()
 
void triggerAsyncUpdate ()
 Causes the callback to be triggered at a later time. More...
 

Static Private Member Functions

static void getNodeConnections (Node &, std::vector< Connection > &)
 

Private Attributes

Atomic< intisPrepared { 0 }
 
NodeID lastNodeID = {}
 
ReferenceCountedArray< Nodenodes
 
std::unique_ptr< RenderSequenceDouble > renderSequenceDouble
 
std::unique_ptr< RenderSequenceFloat > renderSequenceFloat
 

Friends

class AudioGraphIOProcessor
 

Detailed Description

A type of AudioProcessor which plays back a graph of other AudioProcessors.

Use one of these objects if you want to wire-up a set of AudioProcessors and play back the result.

Processors can be added to the graph as "nodes" using addNode(), and once added, you can connect any of their input or output channels to other nodes using addConnection().

To play back a graph through an audio device, you might want to use an AudioProcessorPlayer object.

{Audio}

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

A special index that represents the midi channel of a node.

This is used as a channel index value if you want to refer to the midi input or output instead of an audio channel.

Enumerator
midiChannelIndex 

◆ ProcessingPrecision

Enumerator
singlePrecision 
doublePrecision 

◆ WrapperType

Flags to indicate the type of plugin context in which a processor is being used.

Enumerator
wrapperType_Undefined 
wrapperType_VST 
wrapperType_VST3 
wrapperType_AudioUnit 
wrapperType_AudioUnitv3 
wrapperType_RTAS 
wrapperType_AAX 
wrapperType_Standalone 
wrapperType_Unity 

Constructor & Destructor Documentation

◆ AudioProcessorGraph()

juce::AudioProcessorGraph::AudioProcessorGraph ( )

Creates an empty graph.

◆ ~AudioProcessorGraph()

juce::AudioProcessorGraph::~AudioProcessorGraph ( )
override

Destructor.

Any processor objects that have been added to the graph will also be deleted.

Member Function Documentation

◆ acceptsMidi()

bool juce::AudioProcessorGraph::acceptsMidi ( ) const
overridevirtual

Returns true if the processor wants MIDI messages.

Implements juce::AudioProcessor.

◆ addBus()

bool juce::AudioProcessor::addBus ( bool  isInput)
inherited

Dynamically request an additional bus.

Request an additional bus from the audio processor. If the audio processor does not support adding additional buses then this method will return false.

Most audio processors will not allow you to dynamically add/remove audio buses and will return false.

This method will invoke the canApplyBusCountChange callback to probe if a bus can be added and, if yes, will use the supplied bus properties of the canApplyBusCountChange callback to create a new bus.

See also
canApplyBusCountChange, removeBus

◆ addChangeListener()

void juce::ChangeBroadcaster::addChangeListener ( ChangeListener listener)
inherited

Registers a listener to receive change callbacks from this broadcaster.

Trying to add a listener that's already on the list will have no effect.

◆ addConnection()

bool juce::AudioProcessorGraph::addConnection ( const Connection )

Attempts to connect two specified channels of two nodes.

If this isn't allowed (e.g. because you're trying to connect a midi channel to an audio one or other such nonsense), then it'll return false.

◆ addListener()

virtual void juce::AudioProcessor::addListener ( AudioProcessorListener newListener)
virtualinherited

Adds a listener that will be called when an aspect of this processor changes.

◆ addNode()

Node::Ptr juce::AudioProcessorGraph::addNode ( AudioProcessor newProcessor,
NodeID  nodeId = {} 
)

Adds a node to the graph.

This creates a new node in the graph, for the specified processor. Once you have added a processor to the graph, the graph owns it and will delete it later when it is no longer needed.

The optional nodeId parameter lets you specify an ID to use for the node, but if the value is already in use, this new node will overwrite the old one.

If this succeeds, it returns a pointer to the newly-created node.

◆ addParameter()

void juce::AudioProcessor::addParameter ( AudioProcessorParameter )
inherited

Adds a parameter to the AudioProcessor.

The parameter object will be managed and deleted automatically by the AudioProcessor when no longer needed.

◆ addParameterGroup()

void juce::AudioProcessor::addParameterGroup ( std::unique_ptr< AudioProcessorParameterGroup )
inherited

Adds a group of parameters to the AudioProcessor.

All the parameter objects contained within the group will be managed and deleted automatically by the AudioProcessor when no longer needed.

See also
addParameter

◆ anyNodesNeedPreparing()

bool juce::AudioProcessorGraph::anyNodesNeedPreparing ( ) const
privatenoexcept

◆ beginParameterChangeGesture()

void juce::AudioProcessor::beginParameterChangeGesture ( int  parameterIndex)
inherited

Sends a signal to the host to tell it that the user is about to start changing this parameter.

This allows the host to know when a parameter is actively being held by the user, and it may use this information to help it record automation.

If you call this, it must be matched by a later call to endParameterChangeGesture().

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::beginChangeGesture() instead.deprecated

◆ buildRenderingSequence()

void juce::AudioProcessorGraph::buildRenderingSequence ( )
private

◆ canAddBus()

virtual bool juce::AudioProcessor::canAddBus ( bool  isInput) const
inlinevirtualinherited

Callback to query if a bus can currently be added.

This callback probes if a bus can currently be added. You should override this callback if you want to support dynamically adding/removing buses by the host. This is useful for mixer audio processors.

The default implementation will always return false.

See also
addBus

References juce::ignoreUnused().

◆ canApplyBusCountChange()

virtual bool juce::AudioProcessor::canApplyBusCountChange ( bool  isInput,
bool  isAddingBuses,
BusProperties outNewBusProperties 
)
protectedvirtualinherited

Callback to query if adding/removing buses currently possible.

This callback is called when the host calls addBus or removeBus. Similar to canApplyBusesLayout, this callback is only called while the AudioProcessor is stopped and gives the processor a last chance to reject a requested bus change. It can also be used to apply the bus count change to an underlying wrapped plug-in.

When adding a bus, isAddingBuses will be true and the plug-in is expected to fill out outNewBusProperties with the properties of the bus which will be created just after the successful return of this callback.

Implementations of AudioProcessor will rarely need to override this method. Only override this method if your processor supports adding and removing buses and if it needs more fine grain control over the naming of new buses or may reject bus number changes although canAddBus or canRemoveBus returned true.

The default implementation will return false if canAddBus/canRemoveBus returns false (the default behavior). Otherwise, this method returns "Input #busIndex" for input buses and "Output #busIndex" for output buses where busIndex is the index for newly created buses. The default layout in this case will be the layout of the previous bus of the same direction.

◆ canApplyBusesLayout()

virtual bool juce::AudioProcessor::canApplyBusesLayout ( const BusesLayout layouts) const
inlineprotectedvirtualinherited

Callback to check if a certain bus layout can now be applied.

Most subclasses will not need to override this method and should instead override the isBusesLayoutSupported callback to reject certain layout changes.

This callback is called when the user requests a layout change. It will only be called if processing of the AudioProcessor has been stopped by a previous call to releaseResources or after the construction of the AudioProcessor. It will be called just before the actual layout change. By returning false you will abort the layout change and setBusesLayout will return false indicating that the layout change was not successful.

The default implementation will simply call isBusesLayoutSupported.

You only need to override this method if there is a chance that your AudioProcessor may not accept a layout although you have previously claimed to support it via the isBusesLayoutSupported callback. This can occur if your AudioProcessor's supported layouts depend on other plug-in parameters which may have changed since the last call to isBusesLayoutSupported, such as the format of an audio file which can be selected by the user in the AudioProcessor's editor. This callback gives the AudioProcessor a last chance to reject a layout if conditions have changed as it is always called just before the actual layout change.

As it is never called while the AudioProcessor is processing audio, it can also be used for AudioProcessors which wrap other plug-in formats to apply the current layout to the underlying plug-in. This callback gives such AudioProcessors a chance to reject the layout change should an error occur with the underlying plug-in during the layout change.

See also
isBusesLayoutSupported, setBusesLayout

◆ cancelPendingUpdate()

void juce::AsyncUpdater::cancelPendingUpdate ( )
noexceptinherited

This will stop any pending updates from happening.

If called after triggerAsyncUpdate() and before the handleAsyncUpdate() callback happens, this will cancel the handleAsyncUpdate() callback.

Note that this method simply cancels the next callback - if a callback is already in progress on a different thread, this won't block until the callback finishes, so there's no guarantee that the callback isn't still running when the method returns.

◆ canConnect() [1/2]

bool juce::AudioProcessorGraph::canConnect ( const Connection ) const

Returns true if it would be legal to connect the specified points.

◆ canConnect() [2/2]

bool juce::AudioProcessorGraph::canConnect ( Node src,
int  sourceChannel,
Node dest,
int  destChannel 
) const
privatenoexcept

◆ canRemoveBus()

virtual bool juce::AudioProcessor::canRemoveBus ( bool  isInput) const
inlinevirtualinherited

Callback to query if the last bus can currently be removed.

This callback probes if the last bus can currently be removed. You should override this callback if you want to support dynamically adding/removing buses by the host. This is useful for mixer audio processors.

If you return true in this callback then the AudioProcessor will go ahead and delete the bus.

The default implementation will always return false.

References juce::ignoreUnused().

◆ changeProgramName()

void juce::AudioProcessorGraph::changeProgramName ( int  index,
const String newName 
)
inlineoverridevirtual

Called by the host to rename a program.

Implements juce::AudioProcessor.

◆ checkBusesLayoutSupported()

bool juce::AudioProcessor::checkBusesLayoutSupported ( const BusesLayout ) const
inherited

Returns true if the Audio processor is likely to support a given layout.

This can be called regardless if the processor is currently running.

◆ clear()

void juce::AudioProcessorGraph::clear ( )

Deletes all nodes and connections from this graph.

Any processor objects in the graph will be deleted.

◆ clearRenderingSequence()

void juce::AudioProcessorGraph::clearRenderingSequence ( )
private

◆ containsLayout() [1/2]

static bool juce::AudioProcessor::containsLayout ( const BusesLayout layouts,
const std::initializer_list< const short[2]> &  channelLayoutList 
)
inlinestaticinherited

Returns true if the channel layout map contains a certain layout.

You can use this method to help you implement the checkBusesLayoutSupported method. For example

bool checkBusesLayoutSupported (const BusesLayout& layouts) override
{
return containsLayout (layouts, {{1,1},{2,2}});
}

◆ containsLayout() [2/2]

template<int numLayouts>
static bool juce::AudioProcessor::containsLayout ( const BusesLayout layouts,
const short(&)  channelLayoutList[numLayouts][2] 
)
inlinestaticinherited

◆ copyXmlToBinary()

static void juce::AudioProcessor::copyXmlToBinary ( const XmlElement xml,
juce::MemoryBlock destData 
)
staticinherited

Helper function that just converts an xml element into a binary blob.

Use this in your processor's getStateInformation() method if you want to store its state as xml.

Then use getXmlFromBinary() to reverse this operation and retrieve the XML from a binary blob.

◆ createEditor()

AudioProcessorEditor* juce::AudioProcessorGraph::createEditor ( )
inlineoverridevirtual

Creates the processor's GUI.

This can return nullptr if you want a GUI-less processor, in which case the host may create a generic UI that lets the user twiddle the parameters directly.

If you do want to pass back a component, the component should be created and set to the correct size before returning it. If you implement this method, you must also implement the hasEditor() method and make it return true.

Remember not to do anything silly like allowing your processor to keep a pointer to the component that gets created - it could be deleted later without any warning, which would make your pointer into a dangler. Use the getActiveEditor() method instead.

The correct way to handle the connection between an editor component and its processor is to use something like a ChangeBroadcaster so that the editor can register itself as a listener, and be told when a change occurs. This lets them safely unregister themselves when they are deleted.

Here are a few things to bear in mind when writing an editor:

  • Initially there won't be an editor, until the user opens one, or they might not open one at all. Your processor mustn't rely on it being there.
  • An editor object may be deleted and a replacement one created again at any time.
  • It's safe to assume that an editor will be deleted before its processor.
See also
hasEditor

Implements juce::AudioProcessor.

◆ createEditorIfNeeded()

AudioProcessorEditor* juce::AudioProcessor::createEditorIfNeeded ( )
inherited

Returns the active editor, or if there isn't one, it will create one.

This may call createEditor() internally to create the component.

◆ disableNonMainBuses()

bool juce::AudioProcessor::disableNonMainBuses ( )
inherited

Disables all non-main buses (aux and sidechains).

◆ disconnectNode()

bool juce::AudioProcessorGraph::disconnectNode ( NodeID  )

Removes all connections from the specified node.

◆ dispatchPendingMessages()

void juce::ChangeBroadcaster::dispatchPendingMessages ( )
inherited

If a change message has been sent but not yet dispatched, this will call sendSynchronousChangeMessage() to make the callback immediately.

For thread-safety reasons, you must only call this method on the main message thread.

◆ editorBeingDeleted()

void juce::AudioProcessor::editorBeingDeleted ( AudioProcessorEditor )
noexceptinherited

Not for public use - this is called before deleting an editor component.

◆ enableAllBuses()

bool juce::AudioProcessor::enableAllBuses ( )
inherited

Enables all buses.

◆ endParameterChangeGesture()

void juce::AudioProcessor::endParameterChangeGesture ( int  parameterIndex)
inherited

Tells the host that the user has finished changing this parameter.

This allows the host to know when a parameter is actively being held by the user, and it may use this information to help it record automation.

A call to this method must follow a call to beginParameterChangeGesture().

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::endChangeGesture() instead.deprecated

◆ getAAXPluginIDForMainBusConfig()

virtual int32 juce::AudioProcessor::getAAXPluginIDForMainBusConfig ( const AudioChannelSet mainInputLayout,
const AudioChannelSet mainOutputLayout,
bool  idForAudioSuite 
) const
virtualinherited

AAX plug-ins need to report a unique "plug-in id" for every audio layout configuration that your AudioProcessor supports on the main bus.

Override this function if you want your AudioProcessor to use a custom "plug-in id" (for example to stay backward compatible with older versions of JUCE).

The default implementation will compute a unique integer from the input and output layout and add this value to the 4 character code 'jcaa' (for native AAX) or 'jyaa' (for AudioSuite plug-ins).

◆ getActiveEditor()

AudioProcessorEditor* juce::AudioProcessor::getActiveEditor ( ) const
inlinenoexceptinherited

Returns the active editor, if there is one.

Bear in mind this can return nullptr, even if an editor has previously been opened.

References JUCE_DEPRECATED.

◆ getAlternateDisplayNames()

virtual StringArray juce::AudioProcessor::getAlternateDisplayNames ( ) const
virtualinherited

Returns a list of alternative names to use for this processor.

Some hosts truncate the name of your AudioProcessor when there isn't enough space in the GUI to show the full name. Overriding this method, allows the host to choose an alternative name (such as an abbreviation) to better fit the available space.

◆ getBlockSize()

int juce::AudioProcessor::getBlockSize ( ) const
inlinenoexceptinherited

Returns the current typical block size that is being used.

This can be called from your processBlock() method - it's not guaranteed to be valid at any other time.

Remember it's not the ONLY block size that may be used when calling processBlock, it's just the normal one. The actual block sizes used may be larger or smaller than this, and will vary between successive calls.

◆ getBus() [1/2]

Bus* juce::AudioProcessor::getBus ( bool  isInput,
int  busIndex 
)
inlinenoexceptinherited

Returns the audio bus with a given index and direction.

If busIndex is invalid then this method will return a nullptr.

◆ getBus() [2/2]

const Bus* juce::AudioProcessor::getBus ( bool  isInput,
int  busIndex 
) const
inlinenoexceptinherited

Returns the audio bus with a given index and direction.

If busIndex is invalid then this method will return a nullptr.

◆ getBusBuffer()

template<typename FloatType >
AudioBuffer<FloatType> juce::AudioProcessor::getBusBuffer ( AudioBuffer< FloatType > &  processBlockBuffer,
bool  isInput,
int  busIndex 
) const
inlineinherited

Returns an AudioBuffer containing a set of channel pointers for a specific bus.

This can be called in processBlock to get a buffer containing a sub-group of the master AudioBuffer which contains all the plugin channels.

References juce::AudioBuffer< Type >::getArrayOfWritePointers(), and juce::AudioBuffer< Type >::getNumSamples().

◆ getBusCount()

int juce::AudioProcessor::getBusCount ( bool  isInput) const
inlinenoexceptinherited

Returns the number of buses on the input or output side.

◆ getBusesLayout()

BusesLayout juce::AudioProcessor::getBusesLayout ( ) const
inherited

Provides the current channel layouts of this audio processor.

◆ getBypassParameter()

virtual AudioProcessorParameter* juce::AudioProcessor::getBypassParameter ( ) const
inlinevirtualinherited

Returns the parameter that controls the AudioProcessor's bypass state.

If this method returns a nullptr then you can still control the bypass by calling processBlockBypassed instead of processBlock. On the other hand, if this method returns a non-null value, you should never call processBlockBypassed but use the returned parameter to conrol the bypass state instead.

A plug-in can override this function to return a parameter which control's your plug-in's bypass. You should always check the value of this parameter in your processBlock callback and bypass any effects if it is non-zero.

◆ getCallbackLock()

const CriticalSection& juce::AudioProcessor::getCallbackLock ( ) const
inlinenoexceptinherited

This returns a critical section that will automatically be locked while the host is calling the processBlock() method.

Use it from your UI or other threads to lock access to variables that are used by the process callback, but obviously be careful not to keep it locked for too long, because that could cause stuttering playback. If you need to do something that'll take a long time and need the processing to stop while it happens, use the suspendProcessing() method instead.

See also
suspendProcessing

◆ getChannelCountOfBus()

int juce::AudioProcessor::getChannelCountOfBus ( bool  isInput,
int  busIndex 
) const
inlinenoexceptinherited

Provides the number of channels of the bus with a given index and direction.

If the index, direction combination is invalid then this will return zero.

◆ getChannelIndexInProcessBlockBuffer()

int juce::AudioProcessor::getChannelIndexInProcessBlockBuffer ( bool  isInput,
int  busIndex,
int  channelIndex 
) const
noexceptinherited

Returns the position of a bus's channels within the processBlock buffer.

This can be called in processBlock to figure out which channel of the master AudioBuffer maps onto a specific bus's channel.

◆ getChannelLayoutOfBus()

AudioChannelSet juce::AudioProcessor::getChannelLayoutOfBus ( bool  isInput,
int  busIndex 
) const
noexceptinherited

Provides the channel layout of the bus with a given index and direction.

If the index, direction combination is invalid then this will return an AudioChannelSet with no channels.

◆ getConnections()

std::vector<Connection> juce::AudioProcessorGraph::getConnections ( ) const

Returns the list of connections in the graph.

◆ getCurrentProgram()

int juce::AudioProcessorGraph::getCurrentProgram ( )
inlineoverridevirtual

Returns the number of the currently active program.

Implements juce::AudioProcessor.

◆ getCurrentProgramStateInformation()

virtual void juce::AudioProcessor::getCurrentProgramStateInformation ( juce::MemoryBlock destData)
virtualinherited

The host will call this method if it wants to save the state of just the processor's current program.

Unlike getStateInformation, this should only return the current program's state.

Not all hosts support this, and if you don't implement it, the base class method just calls getStateInformation() instead. If you do implement it, be sure to also implement getCurrentProgramStateInformation.

See also
getStateInformation, setCurrentProgramStateInformation

◆ getDefaultNumParameterSteps()

static int juce::AudioProcessor::getDefaultNumParameterSteps ( )
staticnoexceptinherited

Returns the default number of steps for a parameter.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::getNumSteps() instead.

See also
getParameterNumSteps

Referenced by juce::RangedAudioParameter::getNumSteps().

◆ getLatencySamples()

int juce::AudioProcessor::getLatencySamples ( ) const
inlinenoexceptinherited

This returns the number of samples delay that the processor imposes on the audio passing through it.

The host will call this to find the latency - the processor itself should set this value by calling setLatencySamples() as soon as it can during its initialisation.

◆ getMainBusNumInputChannels()

int juce::AudioProcessor::getMainBusNumInputChannels ( ) const
inlinenoexceptinherited

Returns the number of input channels on the main bus.

◆ getMainBusNumOutputChannels()

int juce::AudioProcessor::getMainBusNumOutputChannels ( ) const
inlinenoexceptinherited

Returns the number of output channels on the main bus.

◆ getName()

const String juce::AudioProcessorGraph::getName ( ) const
overridevirtual

Returns the name of this processor.

Implements juce::AudioProcessor.

◆ getNextBestLayoutInLayoutList()

template<int numLayouts>
BusesLayout juce::AudioProcessor::getNextBestLayoutInLayoutList ( const BusesLayout layouts,
const short(&)  channelLayoutList[numLayouts][2] 
)
inlineinherited

Returns the next best layout which is contained in a channel layout map.

You can use this mehtod to help you implement getNextBestLayout. For example:

BusesLayout getNextBestLayout (const BusesLayout& layouts) override
{
return getNextBestLayoutInLayoutList (layouts, {{1,1},{2,2}});
}

◆ getNode()

Node::Ptr juce::AudioProcessorGraph::getNode ( int  index) const
inlinenoexcept

Returns a pointer to one of the nodes in the graph.

This will return nullptr if the index is out of range.

See also
getNodeForId

◆ getNodeConnections()

static void juce::AudioProcessorGraph::getNodeConnections ( Node ,
std::vector< Connection > &   
)
staticprivate

◆ getNodeForId()

Node* juce::AudioProcessorGraph::getNodeForId ( NodeID  ) const

Searches the graph for a node with the given ID number and returns it.

If no such node was found, this returns nullptr.

See also
getNode

◆ getNodes()

const ReferenceCountedArray<Node>& juce::AudioProcessorGraph::getNodes ( ) const
inlinenoexcept

Returns the array of nodes in the graph.

◆ getNumNodes()

int juce::AudioProcessorGraph::getNumNodes ( ) const
inlinenoexcept

Returns the number of nodes in the graph.

◆ getNumParameters()

virtual int juce::AudioProcessor::getNumParameters ( )
virtualinherited

This must return the correct value immediately after the object has been created, and mustn't change the number of parameters later.

NOTE! This method will eventually be deprecated! It's recommended that you use the AudioProcessorParameter class instead to manage your parameters.deprecated

◆ getNumPrograms()

int juce::AudioProcessorGraph::getNumPrograms ( )
inlineoverridevirtual

Returns the number of preset programs the processor supports.

The value returned must be valid as soon as this object is created, and must not change over its lifetime.

This value shouldn't be less than 1.

Implements juce::AudioProcessor.

◆ getOffsetInBusBufferForAbsoluteChannelIndex()

int juce::AudioProcessor::getOffsetInBusBufferForAbsoluteChannelIndex ( bool  isInput,
int  absoluteChannelIndex,
int busIndex 
) const
noexceptinherited

Returns the offset in a bus's buffer from an absolute channel indes.

This method returns the offset in a bus's buffer given an absolute channel index. It also provides the bus index. For example, this method would return one for a processor with two stereo buses when given the absolute channel index.

◆ getParameter()

virtual float juce::AudioProcessor::getParameter ( int  parameterIndex)
virtualinherited

Called by the host to find out the value of one of the processor's parameters.

The host will expect the value returned to be between 0 and 1.0.

This could be called quite frequently, so try to make your code efficient. It's also likely to be called by non-UI threads, so the code in here should be thread-aware.

NOTE! This method will eventually be deprecated! It's recommended that you use the AudioProcessorParameter class instead to manage your parameters.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ getParameterCategory()

virtual AudioProcessorParameter::Category juce::AudioProcessor::getParameterCategory ( int  parameterIndex) const
virtualinherited

Should return the parameter's category.

By default, this returns the "generic" category.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::getCategory() instead.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ getParameterDefaultValue()

virtual float juce::AudioProcessor::getParameterDefaultValue ( int  parameterIndex)
virtualinherited

Returns the default value for the parameter.

By default, this just returns 0. The value that is returned may or may not be used, depending on the host.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::getDefaultValue() instead.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ getParameterID()

virtual String juce::AudioProcessor::getParameterID ( int  index)
virtualinherited

Returns the ID of a particular parameter.

The ID is used to communicate the value or mapping of a particular parameter with the host. By default this method will simply return a string representation of index.

NOTE! This method will eventually be deprecated! It's recommended that you use the AudioProcessorParameterWithID class instead to manage your parameters.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ getParameterLabel()

virtual String juce::AudioProcessor::getParameterLabel ( int  index) const
virtualinherited

Some plugin types may be able to return a label string for a parameter's units.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::getLabel() instead.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ getParameterName() [1/2]

virtual const String juce::AudioProcessor::getParameterName ( int  parameterIndex)
virtualinherited

Returns the name of a particular parameter.

NOTE! This method will eventually be deprecated! It's recommended that you use the AudioProcessorParameter class instead to manage your parameters.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ getParameterName() [2/2]

virtual String juce::AudioProcessor::getParameterName ( int  parameterIndex,
int  maximumStringLength 
)
virtualinherited

Returns the name of a parameter as a text string with a preferred maximum length.

If you want to provide customised short versions of your parameter names that will look better in constrained spaces (e.g. the displays on hardware controller devices or mixing desks) then you should implement this method. If you don't override it, the default implementation will call getParameterName(int), and truncate the result.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::getName() instead.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ getParameterNumSteps()

virtual int juce::AudioProcessor::getParameterNumSteps ( int  parameterIndex)
virtualinherited

Returns the number of discrete steps that this parameter can represent.

The default return value if you don't implement this method is AudioProcessor::getDefaultNumParameterSteps().

If your parameter is boolean, then you may want to make this return 2.

If you want the host to display stepped automation values, rather than a continuous interpolation between successive values, you should ensure that isParameterDiscrete returns true.

The value that is returned may or may not be used, depending on the host.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::getNumSteps() instead.

See also
isParameterDiscretedeprecated

Reimplemented in juce::AudioPluginInstance.

◆ getParameters()

const OwnedArray<AudioProcessorParameter>& juce::AudioProcessor::getParameters ( ) const
noexceptinherited

Returns the current list of parameters.

◆ getParameterText() [1/2]

virtual const String juce::AudioProcessor::getParameterText ( int  parameterIndex)
virtualinherited

Returns the value of a parameter as a text string.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::getText() instead.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ getParameterText() [2/2]

virtual String juce::AudioProcessor::getParameterText ( int  parameterIndex,
int  maximumStringLength 
)
virtualinherited

Returns the value of a parameter as a text string with a preferred maximum length.

If you want to provide customised short versions of your parameter values that will look better in constrained spaces (e.g. the displays on hardware controller devices or mixing desks) then you should implement this method. If you don't override it, the default implementation will call getParameterText(int), and truncate the result.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::getText() instead.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ getParameterTree()

const AudioProcessorParameterGroup& juce::AudioProcessor::getParameterTree ( )
inherited

Returns the group of parameters managed by this AudioProcessor.

◆ getPlayHead()

AudioPlayHead* juce::AudioProcessor::getPlayHead ( ) const
inlinenoexceptinherited

Returns the current AudioPlayHead object that should be used to find out the state and position of the playhead.

You can ONLY call this from your processBlock() method! Calling it at other times will produce undefined behaviour, as the host may not have any context in which a time would make sense, and some hosts will almost certainly have multithreading issues if it's not called on the audio thread.

The AudioPlayHead object that is returned can be used to get the details about the time of the start of the block currently being processed. But do not store this pointer or use it outside of the current audio callback, because the host may delete or re-use it.

If the host can't or won't provide any time info, this will return nullptr.

◆ getProcessingPrecision()

ProcessingPrecision juce::AudioProcessor::getProcessingPrecision ( ) const
inlinenoexceptinherited

Returns the precision-mode of the processor.

Depending on the result of this method you MUST call the corresponding version of processBlock. The default processing precision is single precision.

See also
setProcessingPrecision, supportsDoublePrecisionProcessing

◆ getProgramName()

const String juce::AudioProcessorGraph::getProgramName ( int  index)
inlineoverridevirtual

Must return the name of a given program.

Implements juce::AudioProcessor.

◆ getResponseCurve()

virtual CurveData juce::AudioProcessor::getResponseCurve ( CurveData::Type  ) const
inlinevirtualinherited

◆ getSampleRate()

double juce::AudioProcessor::getSampleRate ( ) const
inlinenoexceptinherited

Returns the current sample rate.

This can be called from your processBlock() method - it's not guaranteed to be valid at any other time, and may return 0 if it's unknown.

◆ getStateInformation()

void juce::AudioProcessorGraph::getStateInformation ( juce::MemoryBlock destData)
overridevirtual

The host will call this method when it wants to save the processor's internal state.

This must copy any info about the processor's state into the block of memory provided, so that the host can store this and later restore it using setStateInformation().

Note that there's also a getCurrentProgramStateInformation() method, which only stores the current program, not the state of the entire processor.

See also the helper function copyXmlToBinary() for storing settings as XML.

See also
getCurrentProgramStateInformation

Implements juce::AudioProcessor.

◆ getTailLengthSeconds()

double juce::AudioProcessorGraph::getTailLengthSeconds ( ) const
overridevirtual

Returns the length of the processor's tail, in seconds.

Implements juce::AudioProcessor.

◆ getTotalNumInputChannels()

int juce::AudioProcessor::getTotalNumInputChannels ( ) const
inlinenoexceptinherited

Returns the total number of input channels.

This method will return the total number of input channels by accumulating the number of channels on each input bus. The number of channels of the buffer passed to your processBlock callback will be equivalent to either getTotalNumInputChannels or getTotalNumOutputChannels - which ever is greater.

Note that getTotalNumInputChannels is equivalent to getMainBusNumInputChannels if your processor does not have any sidechains or aux buses.

◆ getTotalNumOutputChannels()

int juce::AudioProcessor::getTotalNumOutputChannels ( ) const
inlinenoexceptinherited

Returns the total number of output channels.

This method will return the total number of output channels by accumulating the number of channels on each output bus. The number of channels of the buffer passed to your processBlock callback will be equivalent to either getTotalNumInputChannels or getTotalNumOutputChannels - which ever is greater.

Note that getTotalNumOutputChannels is equivalent to getMainBusNumOutputChannels if your processor does not have any sidechains or aux buses.

◆ getWrapperTypeDescription()

static const char* juce::AudioProcessor::getWrapperTypeDescription ( AudioProcessor::WrapperType  )
staticnoexceptinherited

Returns a textual description of a WrapperType value.

◆ getXmlFromBinary()

static XmlElement* juce::AudioProcessor::getXmlFromBinary ( const void *  data,
int  sizeInBytes 
)
staticinherited

Retrieves an XML element that was stored as binary with the copyXmlToBinary() method.

This might return nullptr if the data's unsuitable or corrupted. Otherwise it will return an XmlElement object that the caller must delete when no longer needed.

◆ handleAsyncUpdate()

void juce::AudioProcessorGraph::handleAsyncUpdate ( )
overrideprivatevirtual

Called back to do whatever your class needs to do.

This method is called by the message thread at the next convenient time after the triggerAsyncUpdate() method has been called.

Implements juce::AsyncUpdater.

◆ handleUpdateNowIfNeeded()

void juce::AsyncUpdater::handleUpdateNowIfNeeded ( )
inherited

If an update has been triggered and is pending, this will invoke it synchronously.

Use this as a kind of "flush" operation - if an update is pending, the handleAsyncUpdate() method will be called immediately; if no update is pending, then nothing will be done.

Because this may invoke the callback, this method must only be called on the main event thread.

◆ hasEditor()

bool juce::AudioProcessorGraph::hasEditor ( ) const
inlineoverridevirtual

Your processor subclass must override this and return true if it can create an editor component.

See also
createEditor

Implements juce::AudioProcessor.

◆ isAnInputTo() [1/2]

bool juce::AudioProcessorGraph::isAnInputTo ( Node source,
Node destination 
) const
noexcept

Does a recursive check to see if there's a direct or indirect series of connections between these two nodes.

◆ isAnInputTo() [2/2]

bool juce::AudioProcessorGraph::isAnInputTo ( Node src,
Node dst,
int  recursionCheck 
) const
privatenoexcept

◆ isBusesLayoutSupported()

virtual bool juce::AudioProcessor::isBusesLayoutSupported ( const BusesLayout ) const
inlineprotectedvirtualinherited

Callback to query if the AudioProcessor supports a specific layout.

This callback is called when the host probes the supported bus layouts via the checkBusesLayoutSupported method. You should override this callback if you would like to limit the layouts that your AudioProcessor supports. The default implementation will accept any layout. JUCE does basic sanity checks so that the provided layouts parameter will have the same number of buses as your AudioProcessor.

See also
checkBusesLayoutSupported

◆ isConnected() [1/3]

bool juce::AudioProcessorGraph::isConnected ( const Connection ) const
noexcept

Returns true if the given connection exists.

◆ isConnected() [2/3]

bool juce::AudioProcessorGraph::isConnected ( NodeID  possibleSourceNodeID,
NodeID  possibleDestNodeID 
) const
noexcept

Returns true if there is a direct connection between any of the channels of two specified nodes.

◆ isConnected() [3/3]

bool juce::AudioProcessorGraph::isConnected ( Node src,
int  sourceChannel,
Node dest,
int  destChannel 
) const
privatenoexcept

◆ isConnectionLegal()

bool juce::AudioProcessorGraph::isConnectionLegal ( const Connection ) const

Returns true if the given connection's channel numbers map on to valid channels at each end.

Even if a connection is valid when created, its status could change if a node changes its channel config.

◆ isLegal()

bool juce::AudioProcessorGraph::isLegal ( Node src,
int  sourceChannel,
Node dest,
int  destChannel 
) const
privatenoexcept

◆ isMetaParameter()

virtual bool juce::AudioProcessor::isMetaParameter ( int  parameterIndex) const
virtualinherited

Should return true if this parameter is a "meta" parameter.

A meta-parameter is a parameter that changes other params. It is used by some hosts (e.g. AudioUnit hosts). By default this returns false.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::isMetaParameter() instead.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ isMidiEffect()

virtual bool juce::AudioProcessor::isMidiEffect ( ) const
inlinevirtualinherited

Returns true if this is a MIDI effect plug-in and does no audio processing.

◆ isNonRealtime()

bool juce::AudioProcessor::isNonRealtime ( ) const
inlinenoexceptinherited

Returns true if the processor is being run in an offline mode for rendering.

If the processor is being run live on realtime signals, this returns false. If the mode is unknown, this will assume it's realtime and return false.

This value may be unreliable until the prepareToPlay() method has been called, and could change each time prepareToPlay() is called.

See also
setNonRealtime()

◆ isParameterAutomatable()

virtual bool juce::AudioProcessor::isParameterAutomatable ( int  parameterIndex) const
virtualinherited

Returns true if the host can automate this parameter.

By default, this returns true for all parameters.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::isAutomatable() instead.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ isParameterDiscrete()

virtual bool juce::AudioProcessor::isParameterDiscrete ( int  parameterIndex) const
virtualinherited

Returns true if the parameter should take discrete, rather than continuous values.

If the parameter is boolean, this should return true (with getParameterNumSteps returning 2).

The value that is returned may or may not be used, depending on the host.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::isDiscrete() instead.

See also
getParameterNumStepsdeprecated

Reimplemented in juce::AudioPluginInstance.

◆ isParameterOrientationInverted()

virtual bool juce::AudioProcessor::isParameterOrientationInverted ( int  index) const
virtualinherited

This can be overridden to tell the host that particular parameters operate in the reverse direction.

(Not all plugin formats or hosts will actually use this information).

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::isOrientationInverted() instead.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ isSuspended()

bool juce::AudioProcessor::isSuspended ( ) const
inlinenoexceptinherited

Returns true if processing is currently suspended.

See also
suspendProcessing

◆ isUpdatePending()

bool juce::AsyncUpdater::isUpdatePending ( ) const
noexceptinherited

Returns true if there's an update callback in the pipeline.

◆ isUsingDoublePrecision()

bool juce::AudioProcessor::isUsingDoublePrecision ( ) const
inlinenoexceptinherited

Returns true if the current precision is set to doublePrecision.

◆ memoryWarningReceived()

virtual void juce::AudioProcessor::memoryWarningReceived ( )
inlinevirtualinherited

Called by the host to indicate that you should reduce your memory footprint.

You should override this method to free up some memory gracefully, if possible, otherwise the host may forcibly unload your AudioProcessor.

At the moment this method is only called when your AudioProcessor is an AUv3 plug-in running on iOS.

References jassertfalse.

◆ numBusesChanged()

virtual void juce::AudioProcessor::numBusesChanged ( )
virtualinherited

This method is called when the number of buses is changed.

◆ numChannelsChanged()

virtual void juce::AudioProcessor::numChannelsChanged ( )
virtualinherited

This method is called when the total number of input or output channels is changed.

◆ prepareToPlay()

void juce::AudioProcessorGraph::prepareToPlay ( double  sampleRate,
int  maximumExpectedSamplesPerBlock 
)
overridevirtual

Called before playback starts, to let the processor prepare itself.

The sample rate is the target sample rate, and will remain constant until playback stops.

You can call getTotalNumInputChannels and getTotalNumOutputChannels or query the busLayout member variable to find out the number of channels your processBlock callback must process.

The maximumExpectedSamplesPerBlock value is a strong hint about the maximum number of samples that will be provided in each block. You may want to use this value to resize internal buffers. You should program defensively in case a buggy host exceeds this value. The actual block sizes that the host uses may be different each time the callback happens: completely variable block sizes can be expected from some hosts.

See also
busLayout, getTotalNumInputChannels, getTotalNumOutputChannels

Implements juce::AudioProcessor.

◆ processBlock() [1/2]

void juce::AudioProcessorGraph::processBlock ( AudioBuffer< float > &  buffer,
MidiBuffer midiMessages 
)
overridevirtual

Renders the next block.

When this method is called, the buffer contains a number of channels which is at least as great as the maximum number of input and output channels that this processor is using. It will be filled with the processor's input data and should be replaced with the processor's output.

So for example if your processor has a total of 2 input channels and 4 output channels, then the buffer will contain 4 channels, the first two being filled with the input data. Your processor should read these, do its processing, and replace the contents of all 4 channels with its output.

Or if your processor has a total of 5 inputs and 2 outputs, the buffer will have 5 channels, all filled with data, and your processor should overwrite the first 2 of these with its output. But be VERY careful not to write anything to the last 3 channels, as these might be mapped to memory that the host assumes is read-only!

If your plug-in has more than one input or output buses then the buffer passed to the processBlock methods will contain a bundle of all channels of each bus. Use getBusBuffer to obtain an audio buffer for a particular bus.

Note that if you have more outputs than inputs, then only those channels that correspond to an input channel are guaranteed to contain sensible data - e.g. in the case of 2 inputs and 4 outputs, the first two channels contain the input, but the last two channels may contain garbage, so you should be careful not to let this pass through without being overwritten or cleared.

Also note that the buffer may have more channels than are strictly necessary, but you should only read/write from the ones that your processor is supposed to be using.

The number of samples in these buffers is NOT guaranteed to be the same for every callback, and may be more or less than the estimated value given to prepareToPlay(). Your code must be able to cope with variable-sized blocks, or you're going to get clicks and crashes!

Also note that some hosts will occasionally decide to pass a buffer containing zero samples, so make sure that your algorithm can deal with that!

If the processor is receiving a MIDI input, then the midiMessages array will be filled with the MIDI messages for this block. Each message's timestamp will indicate the message's time, as a number of samples from the start of the block.

Any messages left in the MIDI buffer when this method has finished are assumed to be the processor's MIDI output. This means that your processor should be careful to clear any incoming messages from the array if it doesn't want them to be passed-on.

If you have implemented the getBypassParameter method, then you need to check the value of this parameter in this callback and bypass your processing if the parameter has a non-zero value.

Note that when calling this method as a host, the result may still be bypassed as the parameter that controls the bypass may be non-zero.

Be very careful about what you do in this callback - it's going to be called by the audio thread, so any kind of interaction with the UI is absolutely out of the question. If you change a parameter in here and need to tell your UI to update itself, the best way is probably to inherit from a ChangeBroadcaster, let the UI components register as listeners, and then call sendChangeMessage() inside the processBlock() method to send out an asynchronous message. You could also use the AsyncUpdater class in a similar way.

See also
getBusBuffer

Implements juce::AudioProcessor.

◆ processBlock() [2/2]

void juce::AudioProcessorGraph::processBlock ( AudioBuffer< double > &  buffer,
MidiBuffer midiMessages 
)
overridevirtual

Renders the next block.

When this method is called, the buffer contains a number of channels which is at least as great as the maximum number of input and output channels that this processor is using. It will be filled with the processor's input data and should be replaced with the processor's output.

So for example if your processor has a combined total of 2 input channels and 4 output channels, then the buffer will contain 4 channels, the first two being filled with the input data. Your processor should read these, do its processing, and replace the contents of all 4 channels with its output.

Or if your processor has 5 inputs and 2 outputs, the buffer will have 5 channels, all filled with data, and your processor should overwrite the first 2 of these with its output. But be VERY careful not to write anything to the last 3 channels, as these might be mapped to memory that the host assumes is read-only!

If your plug-in has more than one input or output buses then the buffer passed to the processBlock methods will contain a bundle of all channels of each bus. Use getBusBuffer to obtain a audio buffer for a particular bus.

Note that if you have more outputs than inputs, then only those channels that correspond to an input channel are guaranteed to contain sensible data - e.g. in the case of 2 inputs and 4 outputs, the first two channels contain the input, but the last two channels may contain garbage, so you should be careful not to let this pass through without being overwritten or cleared.

Also note that the buffer may have more channels than are strictly necessary, but you should only read/write from the ones that your processor is supposed to be using.

If your plugin uses buses, then you should use getBusBuffer() or getChannelIndexInProcessBlockBuffer() to find out which of the input and output channels correspond to which of the buses.

The number of samples in these buffers is NOT guaranteed to be the same for every callback, and may be more or less than the estimated value given to prepareToPlay(). Your code must be able to cope with variable-sized blocks, or you're going to get clicks and crashes!

Also note that some hosts will occasionally decide to pass a buffer containing zero samples, so make sure that your algorithm can deal with that!

If the processor is receiving a MIDI input, then the midiMessages array will be filled with the MIDI messages for this block. Each message's timestamp will indicate the message's time, as a number of samples from the start of the block.

Any messages left in the MIDI buffer when this method has finished are assumed to be the processor's MIDI output. This means that your processor should be careful to clear any incoming messages from the array if it doesn't want them to be passed-on.

If you have implemented the getBypassParameter method, then you need to check the value of this parameter in this callback and bypass your processing if the parameter has a non-zero value.

Note that when calling this method as a host, the result may still be bypassed as the parameter that controls the bypass may be non-zero.

Be very careful about what you do in this callback - it's going to be called by the audio thread, so any kind of interaction with the UI is absolutely out of the question. If you change a parameter in here and need to tell your UI to update itself, the best way is probably to inherit from a ChangeBroadcaster, let the UI components register as listeners, and then call sendChangeMessage() inside the processBlock() method to send out an asynchronous message. You could also use the AsyncUpdater class in a similar way.

See also
getBusBuffer

Reimplemented from juce::AudioProcessor.

◆ processBlockBypassed() [1/2]

virtual void juce::AudioProcessor::processBlockBypassed ( AudioBuffer< float > &  buffer,
MidiBuffer midiMessages 
)
virtualinherited

Renders the next block when the processor is being bypassed.

The default implementation of this method will pass-through any incoming audio, but you may override this method e.g. to add latency compensation to the data to match the processor's latency characteristics. This will avoid situations where bypassing will shift the signal forward in time, possibly creating pre-echo effects and odd timings. Another use for this method would be to cross-fade or morph between the wet (not bypassed) and dry (bypassed) signals.

◆ processBlockBypassed() [2/2]

virtual void juce::AudioProcessor::processBlockBypassed ( AudioBuffer< double > &  buffer,
MidiBuffer midiMessages 
)
virtualinherited

Renders the next block when the processor is being bypassed.

The default implementation of this method will pass-through any incoming audio, but you may override this method e.g. to add latency compensation to the data to match the processor's latency characteristics. This will avoid situations where bypassing will shift the signal forward in time, possibly creating pre-echo effects and odd timings. Another use for this method would be to cross-fade or morph between the wet (not bypassed) and dry (bypassed) signals.

◆ processorLayoutsChanged()

virtual void juce::AudioProcessor::processorLayoutsChanged ( )
virtualinherited

This method is called when the layout of the audio processor changes.

◆ producesMidi()

bool juce::AudioProcessorGraph::producesMidi ( ) const
overridevirtual

Returns true if the processor produces MIDI messages.

Implements juce::AudioProcessor.

◆ releaseResources()

void juce::AudioProcessorGraph::releaseResources ( )
overridevirtual

Called after playback has stopped, to let the object free up any resources it no longer needs.

Implements juce::AudioProcessor.

◆ removeAllChangeListeners()

void juce::ChangeBroadcaster::removeAllChangeListeners ( )
inherited

Removes all listeners from the list.

◆ removeBus()

bool juce::AudioProcessor::removeBus ( bool  isInput)
inherited

Dynamically remove the latest added bus.

Request the removal of the last bus from the audio processor. If the audio processor does not support removing buses then this method will return false.

Most audio processors will not allow you to dynamically add/remove audio buses and will return false.

The default implementation will return false.

This method will invoke the canApplyBusCountChange callback to probe if a bus can currently be removed and, if yes, will go ahead and remove it.

See also
addBus, canRemoveBus

◆ removeChangeListener()

void juce::ChangeBroadcaster::removeChangeListener ( ChangeListener listener)
inherited

Unregisters a listener from the list.

If the listener isn't on the list, this won't have any effect.

◆ removeConnection()

bool juce::AudioProcessorGraph::removeConnection ( const Connection )

Deletes the given connection.

◆ removeIllegalConnections()

bool juce::AudioProcessorGraph::removeIllegalConnections ( )

Performs a sanity checks of all the connections.

This might be useful if some of the processors are doing things like changing their channel counts, which could render some connections obsolete.

◆ removeListener()

virtual void juce::AudioProcessor::removeListener ( AudioProcessorListener listenerToRemove)
virtualinherited

Removes a previously added listener.

◆ removeNode() [1/2]

bool juce::AudioProcessorGraph::removeNode ( NodeID  )

Deletes a node within the graph which has the specified ID.

This will also delete any connections that are attached to this node.

◆ removeNode() [2/2]

bool juce::AudioProcessorGraph::removeNode ( Node )

Deletes a node within the graph.

This will also delete any connections that are attached to this node.

◆ reset()

void juce::AudioProcessorGraph::reset ( )
overridevirtual

A plugin can override this to be told when it should reset any playing voices.

The default implementation does nothing, but a host may call this to tell the plugin that it should stop any tails or sounds that have been left running.

Reimplemented from juce::AudioProcessor.

◆ sendChangeMessage()

void juce::ChangeBroadcaster::sendChangeMessage ( )
inherited

Causes an asynchronous change message to be sent to all the registered listeners.

The message will be delivered asynchronously by the main message thread, so this method will return immediately. To call the listeners synchronously use sendSynchronousChangeMessage().

Referenced by juce::SelectedItemSet< SelectableItemType >::changed().

◆ sendParamChangeMessageToListeners()

void juce::AudioProcessor::sendParamChangeMessageToListeners ( int  parameterIndex,
float  newValue 
)
protectedinherited

◆ sendSynchronousChangeMessage()

void juce::ChangeBroadcaster::sendSynchronousChangeMessage ( )
inherited

Sends a synchronous change message to all the registered listeners.

This will immediately call all the listeners that are registered. For thread-safety reasons, you must only call this method on the main message thread.

See also
dispatchPendingMessages

Referenced by juce::SelectedItemSet< SelectableItemType >::changed().

◆ setBusesLayout()

bool juce::AudioProcessor::setBusesLayout ( const BusesLayout )
inherited

Set the channel layouts of this audio processor.

If the layout is not supported by this audio processor then this method will return false. You can use the checkBusesLayoutSupported and getNextBestLayout methods to probe which layouts this audio processor supports.

◆ setBusesLayoutWithoutEnabling()

bool juce::AudioProcessor::setBusesLayoutWithoutEnabling ( const BusesLayout )
inherited

Set the channel layouts of this audio processor without changing the enablement state of the buses.

If the layout is not supported by this audio processor then this method will return false. You can use the checkBusesLayoutSupported methods to probe which layouts this audio processor supports.

◆ setChannelLayoutOfBus()

bool juce::AudioProcessor::setChannelLayoutOfBus ( bool  isInput,
int  busIndex,
const AudioChannelSet layout 
)
inherited

Set the channel layout of the bus with a given index and direction.

If the index, direction combination is invalid or the layout is not supported by the audio processor then this method will return false.

◆ setCurrentProgram()

void juce::AudioProcessorGraph::setCurrentProgram ( int  index)
inlineoverridevirtual

Called by the host to change the current program.

Implements juce::AudioProcessor.

◆ setCurrentProgramStateInformation()

virtual void juce::AudioProcessor::setCurrentProgramStateInformation ( const void *  data,
int  sizeInBytes 
)
virtualinherited

The host will call this method if it wants to restore the state of just the processor's current program.

Not all hosts support this, and if you don't implement it, the base class method just calls setStateInformation() instead. If you do implement it, be sure to also implement getCurrentProgramStateInformation.

See also
setStateInformation, getCurrentProgramStateInformation

◆ setLatencySamples()

void juce::AudioProcessor::setLatencySamples ( int  newLatency)
inherited

Your processor subclass should call this to set the number of samples delay that it introduces.

The processor should call this as soon as it can during initialisation, and can call it later if the value changes.

◆ setNonRealtime()

void juce::AudioProcessorGraph::setNonRealtime ( bool  isNonRealtime)
overridevirtualnoexcept

Called by the host to tell this processor whether it's being used in a non-realtime capacity for offline rendering or bouncing.

Reimplemented from juce::AudioProcessor.

◆ setParameter()

virtual void juce::AudioProcessor::setParameter ( int  parameterIndex,
float  newValue 
)
virtualinherited

The host will call this method to change the value of one of the processor's parameters.

The host may call this at any time, including during the audio processing callback, so the processor has to process this very fast and avoid blocking.

If you want to set the value of a parameter internally, e.g. from your editor component, then don't call this directly - instead, use the setParameterNotifyingHost() method, which will also send a message to the host telling it about the change. If the message isn't sent, the host won't be able to automate your parameters properly.

The value passed will be between 0 and 1.0.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::setValue() instead.deprecated

Reimplemented in juce::AudioPluginInstance.

◆ setParameterNotifyingHost()

void juce::AudioProcessor::setParameterNotifyingHost ( int  parameterIndex,
float  newValue 
)
inherited

Your processor can call this when it needs to change one of its parameters.

This could happen when the editor or some other internal operation changes a parameter. This method will call the setParameter() method to change the value, and will then send a message to the host telling it about the change.

Note that to make sure the host correctly handles automation, you should call the beginParameterChangeGesture() and endParameterChangeGesture() methods to tell the host when the user has started and stopped changing the parameter.

NOTE! This method will eventually be deprecated! It's recommended that you use AudioProcessorParameter::setValueNotifyingHost() instead.

◆ setPlayConfigDetails()

void juce::AudioProcessor::setPlayConfigDetails ( int  numIns,
int  numOuts,
double  sampleRate,
int  blockSize 
)
inherited

This is called by the processor to specify its details before being played.

Use this version of the function if you are not interested in any sidechain and/or aux buses and do not care about the layout of channels. Otherwise use setRateAndBufferSizeDetails.

◆ setPlayHead()

virtual void juce::AudioProcessor::setPlayHead ( AudioPlayHead newPlayHead)
virtualinherited

Tells the processor to use this playhead object.

The processor will not take ownership of the object, so the caller must delete it when it is no longer being used.

◆ setProcessingPrecision()

void juce::AudioProcessor::setProcessingPrecision ( ProcessingPrecision  newPrecision)
noexceptinherited

Changes the processing precision of the receiver.

A client of the AudioProcessor calls this function to indicate which version of processBlock (single or double precision) it intends to call. The client MUST call this function before calling the prepareToPlay method so that the receiver can do any necessary allocations in the prepareToPlay() method. An implementation of prepareToPlay() should call getProcessingPrecision() to determine with which precision it should allocate it's internal buffers.

Note that setting the processing precision to double floating point precision on a receiver which does not support double precision processing (i.e. supportsDoublePrecisionProcessing() returns false) will result in an assertion.

See also
getProcessingPrecision, supportsDoublePrecisionProcessing

◆ setRateAndBufferSizeDetails()

void juce::AudioProcessor::setRateAndBufferSizeDetails ( double  sampleRate,
int  blockSize 
)
noexceptinherited

This is called by the processor to specify its details before being played.

You should call this function after having informed the processor about the channel and bus layouts via setBusesLayout.

See also
setBusesLayout

◆ setStateInformation()

void juce::AudioProcessorGraph::setStateInformation ( const void *  data,
int  sizeInBytes 
)
overridevirtual

This must restore the processor's state from a block of data previously created using getStateInformation().

Note that there's also a setCurrentProgramStateInformation() method, which tries to restore just the current program, not the state of the entire processor.

See also the helper function getXmlFromBinary() for loading settings as XML.

See also
setCurrentProgramStateInformation

Implements juce::AudioProcessor.

◆ setTypeOfNextNewPlugin()

static void juce::AudioProcessor::setTypeOfNextNewPlugin ( WrapperType  )
staticinherited

◆ supportsDoublePrecisionProcessing()

bool juce::AudioProcessorGraph::supportsDoublePrecisionProcessing ( ) const
overridevirtual

Returns true if the Audio processor supports double precision floating point processing.

The default implementation will always return false. If you return true here then you must override the double precision versions of processBlock. Additionally, you must call getProcessingPrecision() in your prepareToPlay method to determine the precision with which you need to allocate your internal buffers.

See also
getProcessingPrecision, setProcessingPrecision

Reimplemented from juce::AudioProcessor.

◆ supportsMPE()

virtual bool juce::AudioProcessor::supportsMPE ( ) const
inlinevirtualinherited

Returns true if the processor supports MPE.

◆ suspendProcessing()

void juce::AudioProcessor::suspendProcessing ( bool  shouldBeSuspended)
inherited

Enables and disables the processing callback.

If you need to do something time-consuming on a thread and would like to make sure the audio processing callback doesn't happen until you've finished, use this to disable the callback and re-enable it again afterwards.

E.g.

void loadNewPatch()
{
..do something that takes ages..
}

If the host tries to make an audio callback while processing is suspended, the processor will return an empty buffer, but won't block the audio thread like it would do if you use the getCallbackLock() critical section to synchronise access.

Any code that calls processBlock() should call isSuspended() before doing so, and if the processor is suspended, it should avoid the call and emit silence or whatever is appropriate.

See also
getCallbackLock

◆ topologyChanged()

void juce::AudioProcessorGraph::topologyChanged ( )
private

◆ triggerAsyncUpdate()

void juce::AsyncUpdater::triggerAsyncUpdate ( )
inherited

Causes the callback to be triggered at a later time.

This method returns immediately, after which a callback to the handleAsyncUpdate() method will be made by the message thread as soon as possible.

If an update callback is already pending but hasn't happened yet, calling this method will have no effect.

It's thread-safe to call this method from any thread, BUT beware of calling it from a real-time (e.g. audio) thread, because it involves posting a message to the system queue, which means it may block (and in general will do on most OSes).

◆ updateHostDisplay()

void juce::AudioProcessor::updateHostDisplay ( )
inherited

The processor can call this when something (apart from a parameter value) has changed.

It sends a hint to the host that something like the program, number of parameters, etc, has changed, and that it should update itself.

◆ updateTrackProperties()

virtual void juce::AudioProcessor::updateTrackProperties ( const TrackProperties properties)
virtualinherited

Informs the AudioProcessor that track properties such as the track's name or colour has been changed.

If you are hosting this AudioProcessor then use this method to inform the AudioProcessor about which track the AudioProcessor is loaded on. This method may only be called on the message thread.

If you are implemeting an AudioProcessor then you can override this callback to do something useful with the track properties such as changing the colour of your AudioProcessor's editor. It's entirely up to the host when and how often this callback will be called.

The default implementation of this callback will do nothing.

Friends And Related Function Documentation

◆ AudioGraphIOProcessor

friend class AudioGraphIOProcessor
friend

Member Data Documentation

◆ isPrepared

Atomic<int> juce::AudioProcessorGraph::isPrepared { 0 }
private

◆ lastNodeID

NodeID juce::AudioProcessorGraph::lastNodeID = {}
private

◆ nodes

ReferenceCountedArray<Node> juce::AudioProcessorGraph::nodes
private

◆ playHead

AudioPlayHead* juce::AudioProcessor::playHead = nullptr
protectedinherited

◆ renderSequenceDouble

std::unique_ptr<RenderSequenceDouble> juce::AudioProcessorGraph::renderSequenceDouble
private

◆ renderSequenceFloat

std::unique_ptr<RenderSequenceFloat> juce::AudioProcessorGraph::renderSequenceFloat
private

◆ wrapperType

WrapperType juce::AudioProcessor::wrapperType
inherited

When loaded by a plugin wrapper, this flag will be set to indicate the type of plugin within which the processor is running.


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