33 wrapperTypeBeingCreated = type;
43 : wrapperType (wrapperTypeBeingCreated.get())
45 for (
auto& layout :
ioConfig.inputLayouts) createBus (
true, layout);
46 for (
auto& layout :
ioConfig.outputLayouts) createBus (
false, layout);
48 updateSpeakerFormatStrings();
57 jassert (activeEditor ==
nullptr);
60 #if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
104 audioIOChanged (
true, numChannels > 0);
136 for (
int i = 0; i <
numIns; ++i)
137 if (request.getNumChannels (
true, i) == 0)
138 request.getChannelSet (
true, i) = current.getChannelSet (
true, i);
140 for (
int i = 0; i <
numOuts; ++i)
141 if (request.getNumChannels (
false, i) == 0)
142 request.getChannelSet (
false, i) = current.getChannelSet (
false, i);
147 for (
int dir = 0; dir < 2; ++dir)
149 const bool isInput = (dir != 0);
154 auto& set = request.getChannelSet (isInput, i);
156 if (!
bus.isEnabled())
158 if (! set.isDisabled())
159 bus.lastLayout = set;
174 for (
auto& i : outputBuses)
layouts.outputBuses.add (i->getCurrentLayout());
181 if (
auto*
bus = (isInput ? inputBuses : outputBuses)[busIndex])
182 return bus->getCurrentLayout();
191 auto layouts =
bus->getBusesLayoutForLayoutChangeOfBus (layout);
208 for (
auto& i : outputBuses)
layouts.outputBuses.add (i->lastLayout);
215 if (
layouts.inputBuses.size() == inputBuses.size()
216 &&
layouts.outputBuses.size() == outputBuses.size())
240 for (
int dir = 0; dir < 2; ++dir)
242 const bool isInput = (dir > 0);
244 auto&
currentLayouts = (isInput ? currentState.inputBuses : currentState.outputBuses);
310 if (std::abs (defaultLayout.size() -
requested.size()) < distance)
312 current = defaultLayout;
380 auto&
ioBus = isInput ? inputBuses : outputBuses;
383 for (
int i = 0; i <
ioBus.size() && i < busIndex; ++i)
384 channelIndex += getChannelCountOfBus (isInput, i);
391 auto numBuses = getBusCount (isInput);
419 return listeners[index];
424 for (
int i = listeners.size(); --i >= 0;)
425 if (
auto l = getListenerLocked (i))
426 l->audioProcessorChanged (
this,
details);
431 checkForDuplicateParamID (param);
432 checkForDuplicateTrimmedParamID (param);
439 #if JucePlugin_Build_AU
446void AudioProcessor::checkForDuplicateTrimmedParamID ([[
maybe_unused]] AudioProcessorParameter* param)
448 #if JUCE_DEBUG && ! JUCE_DISABLE_CAUTIOUS_PARAMETER_ID_CHECKING
449 if (
auto*
withID =
dynamic_cast<HostedAudioProcessorParameter*
> (param))
453 const auto paramID =
withID->getParameterID();
478void AudioProcessor::checkForDuplicateParamID ([[
maybe_unused]] AudioProcessorParameter* param)
481 if (
auto*
withID =
dynamic_cast<HostedAudioProcessorParameter*
> (param))
491void AudioProcessor::checkForDuplicateGroupIDs ([[
maybe_unused]]
const AudioProcessorParameterGroup&
newGroup)
497 for (
auto* group :
groups)
515 param->processor =
this;
516 param->parameterIndex = flatParameterList.size();
517 flatParameterList.add (param);
519 validateParameter (param);
525 checkForDuplicateGroupIDs (*group);
527 auto oldSize = flatParameterList.size();
528 flatParameterList.addArray (group->getParameters (
true));
530 for (
int i =
oldSize; i < flatParameterList.size(); ++i)
532 auto p = flatParameterList.getUnchecked (i);
534 p->parameterIndex = i;
536 validateParameter (p);
539 parameterTree.
addChild (std::move (group));
547 #if ! JUCE_DISABLE_CAUTIOUS_PARAMETER_ID_CHECKING
552 parameterTree = std::move (
newTree);
553 checkForDuplicateGroupIDs (parameterTree);
557 for (
int i = 0; i < flatParameterList.size(); ++i)
559 auto p = flatParameterList.getUnchecked (i);
561 p->parameterIndex = i;
563 validateParameter (p);
582template <
typename floatType>
618 jassert (precision != doublePrecision || supportsDoublePrecisionProcessing());
620 processingPrecision = precision;
629const String AudioProcessor::getInputChannelName (
int index)
const {
return getChannelName (inputBuses, index); }
630const String AudioProcessor::getOutputChannelName (
int index)
const {
return getChannelName (outputBuses, index); }
639bool AudioProcessor::isInputChannelStereoPair (
int index)
const {
return isStereoPair (inputBuses, index); }
640bool AudioProcessor::isOutputChannelStereoPair (
int index)
const {
return isStereoPair (outputBuses, index); }
643void AudioProcessor::createBus (
bool inputBus,
const BusProperties&
ioConfig)
647 audioIOChanged (
true,
ioConfig.isActivatedByDefault);
655 if (
config[0].inChannels > 0)
658 if (
config[0].outChannels > 0)
664AudioProcessor::BusesLayout AudioProcessor::getNextBestLayoutInList (
const BusesLayout&
layouts,
706 auto outChannels =
legacyLayouts.getReference (i).outChannels;
729 if (
inBus !=
nullptr)
750 if (
layouts.inputBuses.size() > 1 ||
layouts.outputBuses.size() > 1)
754 static_cast<int16> (
layouts.getNumChannels (
false, 0)));
764 for (
int busIndex = 1; busIndex <
layouts.inputBuses.size(); ++busIndex)
767 for (
int busIndex = 1; busIndex <
layouts.outputBuses.size(); ++busIndex)
776void AudioProcessor::updateSpeakerFormatStrings()
778 cachedInputSpeakerArrString.
clear();
779 cachedOutputSpeakerArrString.
clear();
808 const auto& set =
layouts.getChannelSet (
true, busIndex);
811 if (! set.isDisabled())
812 bus.lastLayout = set;
820 const auto& set =
layouts.getChannelSet (
false, busIndex);
823 if (! set.isDisabled())
824 bus.lastLayout = set;
840 for (
int dir = 0; dir < 2; ++dir)
842 const bool isInput = (dir == 0);
845 for (
int i = 0; i < num; ++i)
847 bus->updateChannelCount();
855 n +=
bus->getNumberOfChannels();
863 updateSpeakerFormatStrings();
879 if (activeEditor == editor)
880 activeEditor =
nullptr;
893 if (activeEditor !=
nullptr)
901 jassert (ed->getWidth() > 0 && ed->getHeight() > 0);
927const uint32 magicXmlNumber = 0x21324356;
983 : owner (processor), name (busName),
985 dfltLayout (defaultLayout), lastLayout (defaultLayout),
989 jassert (! dfltLayout.isDisabled());
995AudioProcessor::Bus::BusDirectionAndIndex AudioProcessor::Bus::getDirectionAndIndex()
const noexcept
997 BusDirectionAndIndex
di;
998 di.index = owner.inputBuses.indexOf (
this);
999 di.isInput = (
di.index >= 0);
1002 di.index = owner.outputBuses.indexOf (
this);
1009 auto di = getDirectionAndIndex();
1010 return owner.setChannelLayoutOfBus (
di.isInput,
di.index,
busLayout);
1018 return setCurrentLayout (set);
1020 if (isLayoutSupported (set))
1029 return isLayoutSupported (set);
1034 auto di = getDirectionAndIndex();
1061 if (isNumberOfChannelsSupported (
ch))
1069 auto di = getDirectionAndIndex();
1074 if (! owner.checkBusesLayoutSupported (*
ioLayout))
1076 *
ioLayout = owner.getBusesLayout();
1102 &&
currentLayout.outputBuses.size() == owner.getBusCount (
false));
1112 auto set = supportedLayoutWithChannels (channels);
1113 return (! set.isDisabled()) && isLayoutSupported (set);
1132 if (isLayoutSupported (set))
1140 auto layouts = owner.getBusesLayout();
1141 isLayoutSupported (set, &
layouts);
1147 auto di = getDirectionAndIndex();
1148 return owner.getChannelIndexInProcessBlockBuffer (
di.isInput,
di.index, channelIndex);
1151void AudioProcessor::Bus::updateChannelCount() noexcept
1153 cachedChannelCount = layout.size();
1157void AudioProcessor::BusesProperties::addBus (
bool isInput,
const String& name,
1162 BusProperties props;
1164 props.busName = name;
1165 props.defaultLayout = dfltLayout;
1166 props.isActivatedByDefault = isActivatedByDefault;
1168 (isInput ? inputLayouts : outputLayouts).add (props);
1171AudioProcessor::BusesProperties AudioProcessor::BusesProperties::withInput (
const String& name,
1172 const AudioChannelSet& dfltLayout,
1173 bool isActivatedByDefault)
const
1176 retval.addBus (
true, name, dfltLayout, isActivatedByDefault);
1180AudioProcessor::BusesProperties AudioProcessor::BusesProperties::withOutput (
const String& name,
1181 const AudioChannelSet& dfltLayout,
1182 bool isActivatedByDefault)
const
1185 retval.addBus (
false, name, dfltLayout, isActivatedByDefault);
1194 case AudioProcessor::wrapperType_Undefined:
return "Undefined";
1195 case AudioProcessor::wrapperType_VST:
return "VST";
1196 case AudioProcessor::wrapperType_VST3:
return "VST3";
1197 case AudioProcessor::wrapperType_AudioUnit:
return "AU";
1198 case AudioProcessor::wrapperType_AudioUnitv3:
return "AUv3";
1199 case AudioProcessor::wrapperType_AAX:
return "AAX";
1200 case AudioProcessor::wrapperType_Standalone:
return "Standalone";
1201 case AudioProcessor::wrapperType_Unity:
return "Unity";
1202 case AudioProcessor::wrapperType_LV2:
return "LV2";
1265JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE (
"-Wdeprecated-declarations")
1266JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
1272 param->setValueNotifyingHost (newValue);
1277 sendParamChangeMessageToListeners (parameterIndex, newValue);
1281void AudioProcessor::sendParamChangeMessageToListeners (
int parameterIndex,
float newValue)
1285 param->sendValueChangedMessageToListeners (newValue);
1291 for (
int i = listeners.size(); --i >= 0;)
1292 if (
auto*
l = getListenerLocked (i))
1293 l->audioProcessorParameterChanged (
this, parameterIndex, newValue);
1302void AudioProcessor::beginParameterChangeGesture (
int parameterIndex)
1306 param->beginChangeGesture();
1312 #if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
1319 for (
int i = listeners.size(); --i >= 0;)
1320 if (
auto*
l = getListenerLocked (i))
1321 l->audioProcessorParameterChangeGestureBegin (
this, parameterIndex);
1330void AudioProcessor::endParameterChangeGesture (
int parameterIndex)
1334 param->endChangeGesture();
1340 #if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
1348 for (
int i = listeners.size(); --i >= 0;)
1349 if (
auto*
l = getListenerLocked (i))
1350 l->audioProcessorParameterChangeGestureEnd (
this, parameterIndex);
1368const String AudioProcessor::getParameterText (
int index)
1390int AudioProcessor::getNumParameters()
1395float AudioProcessor::getParameter (
int index)
1397 if (
auto* p = getParamChecked (index))
1398 return p->getValue();
1403void AudioProcessor::setParameter (
int index,
float newValue)
1405 if (
auto* p = getParamChecked (index))
1406 p->setValue (newValue);
1409float AudioProcessor::getParameterDefaultValue (
int index)
1412 return p->getDefaultValue();
1417const String AudioProcessor::getParameterName (
int index)
1419 if (
auto* p = getParamChecked (index))
1420 return p->getName (512);
1425String AudioProcessor::getParameterID (
int index)
1428 if (
auto* p =
dynamic_cast<HostedAudioProcessorParameter*
> (
getParameters()[index]))
1429 return p->getParameterID();
1431 return String (index);
1434int AudioProcessor::getParameterNumSteps (
int index)
1437 return p->getNumSteps();
1442bool AudioProcessor::isParameterDiscrete (
int index)
const
1445 return p->isDiscrete();
1450String AudioProcessor::getParameterLabel (
int index)
const
1453 return p->getLabel();
1458bool AudioProcessor::isParameterAutomatable (
int index)
const
1461 return p->isAutomatable();
1466bool AudioProcessor::isParameterOrientationInverted (
int index)
const
1469 return p->isOrientationInverted();
1474bool AudioProcessor::isMetaParameter (
int index)
const
1477 return p->isMetaParameter();
1485 return p->getCategory();
1490AudioProcessorParameter* AudioProcessor::getParamChecked (
int index)
const
1504JUCE_END_IGNORE_WARNINGS_GCC_LIKE
1505JUCE_END_IGNORE_WARNINGS_MSVC
1514 #if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
1523 setValue (newValue);
1524 sendValueChangedMessageToListeners (newValue);
1530 jassert (processor !=
nullptr && parameterIndex >= 0);
1532 #if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
1542 for (
int i = listeners.size(); --i >= 0;)
1543 if (
auto*
l = listeners[i])
1544 l->parameterGestureChanged (getParameterIndex(),
true);
1546 if (processor !=
nullptr && parameterIndex >= 0)
1550 for (
int i = processor->listeners.size(); --i >= 0;)
1551 if (
auto*
l = processor->listeners[i])
1552 l->audioProcessorParameterChangeGestureBegin (processor, getParameterIndex());
1559 jassert (processor !=
nullptr && parameterIndex >= 0);
1561 #if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
1571 for (
int i = listeners.size(); --i >= 0;)
1572 if (
auto*
l = listeners[i])
1573 l->parameterGestureChanged (getParameterIndex(),
false);
1575 if (processor !=
nullptr && parameterIndex >= 0)
1579 for (
int i = processor->listeners.size(); --i >= 0;)
1580 if (
auto*
l = processor->listeners[i])
1581 l->audioProcessorParameterChangeGestureEnd (processor, getParameterIndex());
1585void AudioProcessorParameter::sendValueChangedMessageToListeners (
float newValue)
1589 for (
int i = listeners.size(); --i >= 0;)
1590 if (
auto*
l = listeners [i])
1591 l->parameterValueChanged (getParameterIndex(), newValue);
1593 if (processor !=
nullptr && parameterIndex >= 0)
1597 for (
int i = processor->listeners.size(); --i >= 0;)
1598 if (
auto*
l = processor->listeners[i])
1599 l->audioProcessorParameterChanged (processor, getParameterIndex(), newValue);
1613 return String (value, 2);
1618 return getText (getValue(), 1024);
1623 if (isDiscrete() && valueStrings.isEmpty())
1627 for (
int i = 0; i < getNumSteps(); ++i)
1628 valueStrings.
add (getText ((
float) i / (
float)
maxIndex, 1024));
1631 return valueStrings;
Holds a resizable array of primitive or copy-by-value objects.
A multi-channel buffer containing floating point audio samples.
int getNumSamples() const noexcept
Returns the number of samples allocated in each of the buffer's channels.
void clear() noexcept
Clears all the samples in all channels and marks the buffer as cleared.
Represents a set of audio channel types.
static AudioChannelSet JUCE_CALLTYPE namedChannelSet(int numChannels)
Create a channel set for a given number of channels which is non-discrete.
static AudioChannelSet JUCE_CALLTYPE disabled()
Creates a zero-channel set which can be used to indicate that a bus is disabled.
bool isDisabled() const noexcept
Returns true if there are no channels in the set.
static Array< AudioChannelSet > JUCE_CALLTYPE channelSetsWithNumberOfChannels(int numChannels)
Return an array of channel sets which have a given number of channels.
static AudioChannelSet JUCE_CALLTYPE stereo()
Creates a set containing a stereo set (left, right).
static String JUCE_CALLTYPE getChannelTypeName(ChannelType)
Returns the name of a given channel type.
String getSpeakerArrangementAsString() const
Returns a string containing a whitespace-separated list of speaker types corresponding to each channe...
static AudioChannelSet JUCE_CALLTYPE canonicalChannelSet(int numChannels)
Create a canonical channel set for a given number of channels.
static AudioChannelSet JUCE_CALLTYPE discreteChannels(int numChannels)
Creates a set of untyped discrete channels.
A subclass of AudioPlayHead can supply information about the position and status of a moving play hea...
Base class for the component that acts as the GUI for an AudioProcessor.
Base class for listeners that want to know about changes to an AudioProcessor.
virtual void audioProcessorParameterChangeGestureBegin(AudioProcessor *processor, int parameterIndex)
Indicates that a parameter change gesture has started.
virtual void audioProcessorParameterChangeGestureEnd(AudioProcessor *processor, int parameterIndex)
Indicates that a parameter change gesture has finished.
A class encapsulating a group of AudioProcessorParameters and nested AudioProcessorParameterGroups.
void addChild(std::unique_ptr< ParameterOrGroup > child)
Adds a child to the group.
Array< AudioProcessorParameter * > getParameters(bool recursive) const
Returns all the parameters in this group.
A base class for listeners that want to know about changes to an AudioProcessorParameter.
An abstract base class for parameter objects that can be added to an AudioProcessor.
virtual String getCurrentValueAsText() const
Returns the current value of the parameter as a String.
virtual String getText(float normalisedValue, int) const
Returns a textual version of the supplied normalised parameter value.
virtual int getNumSteps() const
Returns the number of steps that this parameter's range should be quantised into.
virtual bool isMetaParameter() const
Should return true if this parameter is a "meta" parameter.
virtual bool isAutomatable() const
Returns true if the host can automate this parameter.
virtual ~AudioProcessorParameter()
Destructor.
void beginChangeGesture()
Sends a signal to the host to tell it that the user is about to start changing this parameter.
void removeListener(Listener *listener)
Removes a previously registered parameter listener.
virtual StringArray getAllValueStrings() const
Returns the set of strings which represent the possible states a parameter can be in.
@ genericParameter
If your parameter is not a meter then you should use this category.
void setValueNotifyingHost(float newValue)
A processor should call this when it needs to change one of its parameters.
void endChangeGesture()
Tells the host that the user has finished changing this parameter.
virtual bool isDiscrete() const
Returns whether the parameter uses discrete values, based on the result of getNumSteps,...
virtual bool isOrientationInverted() const
This can be overridden to tell the host that this parameter operates in the reverse direction.
void addListener(Listener *newListener)
Registers a listener to receive events when the parameter's state changes.
virtual bool isBoolean() const
Returns whether the parameter represents a boolean switch, typically with "On" and "Off" states.
virtual Category getCategory() const
Returns the parameter's category.
int getVersionHint() const
AudioChannelSet supportedLayoutWithChannels(int channels) const
Returns a ChannelSet that the bus supports with a given number of channels.
const AudioChannelSet & getCurrentLayout() const noexcept
The bus's current layout.
bool enable(bool shouldEnable=true)
Enable or disable this bus.
bool isNumberOfChannelsSupported(int channels) const
Checks if this bus can support a given number of channels.
bool setCurrentLayoutWithoutEnabling(const AudioChannelSet &layout)
Sets the bus's current layout without changing the enabled state.
const AudioChannelSet & getDefaultLayout() const noexcept
Get the default layout of this bus.
bool setCurrentLayout(const AudioChannelSet &layout)
Sets the bus's current layout.
int getBusIndex() const noexcept
Returns the index of this bus.
int getChannelIndexInProcessBlockBuffer(int channelIndex) const noexcept
Returns the position of a bus's channels within the processBlock buffer.
bool setNumberOfChannels(int channels)
Set the number of channels of this bus.
int getMaxSupportedChannels(int limit=AudioChannelSet::maxChannelsOfNamedLayout) const
Returns the maximum number of channels that this bus can support.
bool isLayoutSupported(const AudioChannelSet &set, BusesLayout *currentLayout=nullptr) const
Checks if a particular layout is supported.
bool isInput() const noexcept
Returns true if this bus is an input bus.
BusesLayout getBusesLayoutForLayoutChangeOfBus(const AudioChannelSet &set) const
Returns the resulting layouts of all buses after changing the layout of this bus.
Base class for audio processing classes or plugins.
virtual bool canApplyBusesLayout(const BusesLayout &layouts) const
Callback to check if a certain bus layout can now be applied.
int getTotalNumInputChannels() const noexcept
Returns the total number of input channels.
int getChannelIndexInProcessBlockBuffer(bool isInput, int busIndex, int channelIndex) const noexcept
Returns the position of a bus's channels within the processBlock buffer.
bool enableAllBuses()
Enables all buses.
WrapperType
Flags to indicate the type of plugin context in which a processor is being used.
void setProcessingPrecision(ProcessingPrecision newPrecision) noexcept
Changes the processing precision of the receiver.
virtual void processBlockBypassed(AudioBuffer< float > &buffer, MidiBuffer &midiMessages)
Renders the next block when the processor is being bypassed.
Bus * getBus(bool isInput, int busIndex) noexcept
Returns the audio bus with a given index and direction.
const WrapperType wrapperType
When loaded by a plugin wrapper, this flag will be set to indicate the type of plugin within which th...
void updateHostDisplay(const ChangeDetails &details=ChangeDetails::getDefaultFlags())
The processor can call this when something (apart from a parameter value) has changed.
int getLatencySamples() const noexcept
This returns the number of samples delay that the processor imposes on the audio passing through it.
void setParameterTree(AudioProcessorParameterGroup &&newTree)
Sets the group of parameters managed by this AudioProcessor.
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 offl...
BusesLayout getBusesLayout() const
Provides the current channel layouts of this audio processor.
bool disableNonMainBuses()
Disables all non-main buses (aux and sidechains).
bool checkBusesLayoutSupported(const BusesLayout &) const
Returns true if the Audio processor is likely to support a given layout.
void addParameter(AudioProcessorParameter *)
Adds a parameter to the AudioProcessor.
virtual bool supportsDoublePrecisionProcessing() const
Returns true if the Audio processor supports double precision floating point processing.
virtual bool applyBusLayouts(const BusesLayout &layouts)
This method will be called when a new bus layout needs to be applied.
virtual void removeListener(AudioProcessorListener *listenerToRemove)
Removes a previously added listener.
virtual void updateTrackProperties(const TrackProperties &properties)
Informs the AudioProcessor that track properties such as the track's name or colour has been changed.
void setLatencySamples(int newLatency)
Your processor subclass should call this to set the number of samples delay that it introduces.
bool removeBus(bool isInput)
Dynamically remove the latest added bus.
int getBusCount(bool isInput) const noexcept
Returns the number of buses on the input or output side.
virtual void getStateInformation(juce::MemoryBlock &destData)=0
The host will call this method when it wants to save the processor's internal state.
static std::unique_ptr< XmlElement > getXmlFromBinary(const void *data, int sizeInBytes)
Retrieves an XML element that was stored as binary with the copyXmlToBinary() method.
int getOffsetInBusBufferForAbsoluteChannelIndex(bool isInput, int absoluteChannelIndex, int &busIndex) const noexcept
Returns the offset in a bus's buffer from an absolute channel index.
void suspendProcessing(bool shouldBeSuspended)
Enables and disables the processing callback.
virtual void setPlayHead(AudioPlayHead *newPlayHead)
Tells the processor to use this playhead object.
virtual AudioProcessorEditor * createEditor()=0
Creates the processor's GUI.
virtual void numBusesChanged()
This method is called when the number of buses is changed.
virtual void processBlock(AudioBuffer< float > &buffer, MidiBuffer &midiMessages)=0
Renders the next block.
AudioProcessorEditor * getActiveEditor() const noexcept
Returns the active editor, if there is one.
virtual const String getName() const =0
Returns the name of this processor.
AudioProcessorEditor * createEditorIfNeeded()
Returns the active editor, or if there isn't one, it will create one.
bool addBus(bool isInput)
Dynamically request an additional bus.
void editorBeingDeleted(AudioProcessorEditor *) noexcept
Not for public use - this is called before deleting an editor component.
const AudioProcessorParameterGroup & getParameterTree() const
Returns the group of parameters managed by this AudioProcessor.
virtual void addListener(AudioProcessorListener *newListener)
Adds a listener that will be called when an aspect of this processor changes.
int getChannelCountOfBus(bool isInput, int busIndex) const noexcept
Provides the number of channels of the bus with a given index and direction.
const Array< AudioProcessorParameter * > & getParameters() const
Returns a flat list of the parameters in the current tree.
virtual bool hasEditor() const =0
Your processor subclass must override this and return true if it can create an editor component.
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.
virtual void processorLayoutsChanged()
This method is called when the layout of the audio processor changes.
static void copyXmlToBinary(const XmlElement &xml, juce::MemoryBlock &destData)
Helper function that just converts an xml element into a binary blob.
virtual void setStateInformation(const void *data, int sizeInBytes)=0
This must restore the processor's state from a block of data previously created using getStateInforma...
static int getDefaultNumParameterSteps() noexcept
Returns the default number of steps for a parameter.
void addParameterGroup(std::unique_ptr< AudioProcessorParameterGroup >)
Adds a group of parameters to the AudioProcessor.
void setPlayConfigDetails(int numIns, int numOuts, double sampleRate, int blockSize)
This is called by the processor to specify its details before being played.
virtual bool isBusesLayoutSupported(const BusesLayout &) const
Callback to query if the AudioProcessor supports a specific layout.
AudioChannelSet getChannelLayoutOfBus(bool isInput, int busIndex) const noexcept
Provides the channel layout of the bus with a given index and direction.
virtual void numChannelsChanged()
This method is called when the total number of input or output channels is changed.
virtual void refreshParameterList()
A processor should implement this method so that the host can ask it to rebuild its parameter tree.
virtual VST2ClientExtensions * getVST2ClientExtensions()
Returns a non-owning pointer to an object that implements VST2 specific information regarding this Au...
bool setChannelLayoutOfBus(bool isInput, int busIndex, const AudioChannelSet &layout)
Set the channel layout of the bus with a given index and direction.
virtual StringArray getAlternateDisplayNames() const
Returns a list of alternative names to use for this processor.
virtual bool canAddBus(bool isInput) const
Callback to query if a bus can currently be added.
bool setBusesLayoutWithoutEnabling(const BusesLayout &)
Set the channel layouts of this audio processor without changing the enablement state of the buses.
int getTotalNumOutputChannels() const noexcept
Returns the total number of output channels.
virtual VST3ClientExtensions * getVST3ClientExtensions()
Returns a non-owning pointer to an object that implements VST3 specific information regarding this Au...
virtual bool canApplyBusCountChange(bool isInput, bool isAddingBuses, BusProperties &outNewBusProperties)
Callback to query if adding/removing buses currently possible.
virtual ~AudioProcessor()
Destructor.
virtual void reset()
A plugin can override this to be told when it should reset any playing voices.
static const char * getWrapperTypeDescription(AudioProcessor::WrapperType) noexcept
Returns a textual description of a WrapperType value.
bool setBusesLayout(const BusesLayout &)
Set the channel layouts of this audio processor.
virtual bool canRemoveBus(bool isInput) const
Callback to query if the last bus can currently be removed.
int getMainBusNumInputChannels() const noexcept
Returns the number of input channels on the main bus.
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 progr...
void setRateAndBufferSizeDetails(double sampleRate, int blockSize) noexcept
This is called by the processor to specify its details before being played.
AudioProcessor()
Constructor.
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.
Structure used for AudioProcessor Callbacks.
A struct containing information about the DAW track inside which your AudioProcessor is loaded.
static constexpr uint32 littleEndianInt(const void *bytes) noexcept
Turns 4 bytes into a little-endian integer.
static Type swapIfBigEndian(Type value) noexcept
Swaps the byte order of a signed or unsigned integer if the CPU is big-endian.
Automatically locks and unlocks a mutex object.
A class to hold a resizable block of raw data.
void * getData() noexcept
Returns a void pointer to the data.
size_t getSize() const noexcept
Returns the block's current allocated size, in bytes.
Writes data to an internal memory buffer, which grows as required.
Holds a sequence of time-stamped midi events.
virtual bool writeByte(char byte)
Writes a single byte to the stream.
virtual bool writeInt(int value)
Writes a 32-bit integer to the stream in a little-endian byte order.
An array designed for holding objects.
A special array for holding a list of strings.
void add(String stringToAdd)
Appends a string at the end of the array.
void clear() noexcept
Resets this string to be empty.
static String fromUTF8(const char *utf8buffer, int bufferSizeBytes=-1)
Creates a String from a UTF-8 encoded buffer.
Used to build a tree of elements representing an XML document.
void writeTo(OutputStream &output, const TextFormat &format={}) const
Writes the document to a stream as UTF-8.
constexpr Type jmin(Type a, Type b)
Returns the smaller of two values.
signed short int16
A platform-independent 16-bit signed integer type.
std::unique_ptr< XmlElement > parseXML(const String &textToParse)
Attempts to parse some XML text, returning a new XmlElement if it was valid.
Type * addBytesToPointer(Type *basePointer, IntegerType bytes) noexcept
A handy function which adds a number of bytes to any type of pointer and returns the result.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Returns true if a value is at least zero, and also below a specified upper limit.
unsigned int uint32
A platform-independent 32-bit unsigned integer type.
Provides details about aspects of an AudioProcessor which have changed.
Represents the bus layout state of a plug-in.
Array< AudioChannelSet > inputBuses
An array containing the list of input buses that this processor supports.
Structure used for AudioProcessor Callbacks.
An interface to allow an AudioProcessor to implement extended VST2-specific functionality.
An interface to allow an AudioProcessor to implement extended VST3-specific functionality.
A struct containing options for formatting the text when representing an XML element as a string.