JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_AudioProcessor.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
47class JUCE_API AudioProcessor : private AAXClientExtensions
48{
49protected:
50 struct BusesProperties;
51
52 //==============================================================================
59
65 AudioProcessor (const BusesProperties& ioLayouts);
66
70 AudioProcessor (const std::initializer_list<const short[2]>& channelLayoutList)
71 : AudioProcessor (busesPropertiesFromLayoutArray (layoutListToArray (channelLayoutList)))
72 {
73 }
74
75public:
76 //==============================================================================
77 enum ProcessingPrecision
78 {
79 singlePrecision,
80 doublePrecision
81 };
82
83 enum class Realtime
84 {
85 no,
86 yes
87 };
88
89 using ChangeDetails = AudioProcessorListener::ChangeDetails;
90
91 //==============================================================================
93 virtual ~AudioProcessor();
94
95 //==============================================================================
97 virtual const String getName() const = 0;
98
106 virtual StringArray getAlternateDisplayNames() const;
107
108 //==============================================================================
127 virtual void prepareToPlay (double sampleRate,
128 int maximumExpectedSamplesPerBlock) = 0;
129
133 virtual void releaseResources() = 0;
134
144
209 virtual void processBlock (AudioBuffer<float>& buffer,
210 MidiBuffer& midiMessages) = 0;
211
280 virtual void processBlock (AudioBuffer<double>& buffer,
281 MidiBuffer& midiMessages);
282
292 virtual void processBlockBypassed (AudioBuffer<float>& buffer,
293 MidiBuffer& midiMessages);
294
304 virtual void processBlockBypassed (AudioBuffer<double>& buffer,
305 MidiBuffer& midiMessages);
306
307
308 //==============================================================================
313 {
314 private:
315 template <typename This>
316 static auto& getBuses (This& t, bool isInput) { return isInput ? t.inputBuses : t.outputBuses; }
317
318 public:
321
324
325 auto& getBuses (bool isInput) const { return getBuses (*this, isInput); }
326 auto& getBuses (bool isInput) { return getBuses (*this, isInput); }
327
329 int getNumChannels (bool isInput, int busIndex) const noexcept
330 {
331 auto& bus = getBuses (isInput);
332 return isPositiveAndBelow (busIndex, bus.size()) ? bus.getReference (busIndex).size() : 0;
333 }
334
336 AudioChannelSet& getChannelSet (bool isInput, int busIndex) noexcept
337 {
338 return getBuses (isInput).getReference (busIndex);
339 }
340
342 AudioChannelSet getChannelSet (bool isInput, int busIndex) const noexcept
343 {
344 return getBuses (isInput)[busIndex];
345 }
346
348 AudioChannelSet getMainInputChannelSet() const noexcept { return getChannelSet (true, 0); }
349
351 AudioChannelSet getMainOutputChannelSet() const noexcept { return getChannelSet (false, 0); }
352
354 int getMainInputChannels() const noexcept { return getNumChannels (true, 0); }
355
357 int getMainOutputChannels() const noexcept { return getNumChannels (false, 0); }
358
359 bool operator== (const BusesLayout& other) const noexcept { return inputBuses == other.inputBuses && outputBuses == other.outputBuses; }
360 bool operator!= (const BusesLayout& other) const noexcept { return inputBuses != other.inputBuses || outputBuses != other.outputBuses; }
361 };
362
363 //==============================================================================
370 class Bus
371 {
372 public:
374 bool isInput() const noexcept;
375
377 int getBusIndex() const noexcept;
378
380 bool isMain() const noexcept { return getBusIndex() == 0; }
381
382 //==============================================================================
384 const String& getName() const noexcept { return name; }
385
389 const AudioChannelSet& getDefaultLayout() const noexcept { return dfltLayout; }
390
391 //==============================================================================
396 const AudioChannelSet& getCurrentLayout() const noexcept { return layout; }
397
403 const AudioChannelSet& getLastEnabledLayout() const noexcept { return lastLayout; }
404
409 bool setCurrentLayout (const AudioChannelSet& layout);
410
415 bool setCurrentLayoutWithoutEnabling (const AudioChannelSet& layout);
416
418 inline int getNumberOfChannels() const noexcept { return cachedChannelCount; }
419
423 bool setNumberOfChannels (int channels);
424
425 //==============================================================================
437 bool isLayoutSupported (const AudioChannelSet& set, BusesLayout* currentLayout = nullptr) const;
438
440 bool isNumberOfChannelsSupported (int channels) const;
441
443 AudioChannelSet supportedLayoutWithChannels (int channels) const;
444
448 int getMaxSupportedChannels (int limit = AudioChannelSet::maxChannelsOfNamedLayout) const;
449
458 BusesLayout getBusesLayoutForLayoutChangeOfBus (const AudioChannelSet& set) const;
459
460 //==============================================================================
462 bool isEnabled() const noexcept { return ! layout.isDisabled(); }
463
466 bool enable (bool shouldEnable = true);
467
469 bool isEnabledByDefault() const noexcept { return enabledByDefault; }
470
471 //==============================================================================
476 int getChannelIndexInProcessBlockBuffer (int channelIndex) const noexcept;
477
478
483 template <typename FloatType>
485 {
486 auto di = getDirectionAndIndex();
487 return owner.getBusBuffer (processBlockBuffer, di.isInput, di.index);
488 }
489
490 private:
491 friend class AudioProcessor;
492 Bus (AudioProcessor&, const String&, const AudioChannelSet&, bool);
493
494 struct BusDirectionAndIndex
495 {
496 bool isInput;
497 int index;
498 };
499
500 BusDirectionAndIndex getDirectionAndIndex() const noexcept;
501 void updateChannelCount() noexcept;
502
503 AudioProcessor& owner;
504 String name;
505 AudioChannelSet layout, dfltLayout, lastLayout;
506 bool enabledByDefault;
507 int cachedChannelCount;
508
510 };
511
512 //==============================================================================
514 int getBusCount (bool isInput) const noexcept { return (isInput ? inputBuses : outputBuses).size(); }
515
519 Bus* getBus (bool isInput, int busIndex) noexcept { return getBusImpl (*this, isInput, busIndex); }
520
524 const Bus* getBus (bool isInput, int busIndex) const noexcept { return getBusImpl (*this, isInput, busIndex); }
525
526 //==============================================================================
537 virtual bool canAddBus (bool isInput) const;
538
550 virtual bool canRemoveBus (bool isInput) const;
551
566 bool addBus (bool isInput);
567
584 bool removeBus (bool isInput);
585
586 //==============================================================================
594 bool setBusesLayout (const BusesLayout&);
595
603 bool setBusesLayoutWithoutEnabling (const BusesLayout&);
604
606 BusesLayout getBusesLayout() const;
607
613 AudioChannelSet getChannelLayoutOfBus (bool isInput, int busIndex) const noexcept;
614
620 bool setChannelLayoutOfBus (bool isInput, int busIndex, const AudioChannelSet& layout);
621
626 inline int getChannelCountOfBus (bool isInput, int busIndex) const noexcept
627 {
628 if (auto* bus = getBus (isInput, busIndex))
629 return bus->getNumberOfChannels();
630
631 return 0;
632 }
633
635 bool enableAllBuses();
636
638 bool disableNonMainBuses();
639
640 //==============================================================================
645 int getChannelIndexInProcessBlockBuffer (bool isInput, int busIndex, int channelIndex) const noexcept;
646
653 int getOffsetInBusBufferForAbsoluteChannelIndex (bool isInput, int absoluteChannelIndex, int& busIndex) const noexcept;
654
659 template <typename FloatType>
660 AudioBuffer<FloatType> getBusBuffer (AudioBuffer<FloatType>& processBlockBuffer, bool isInput, int busIndex) const
661 {
662 auto busNumChannels = getChannelCountOfBus (isInput, busIndex);
663 auto channelOffset = getChannelIndexInProcessBlockBuffer (isInput, busIndex, 0);
664
665 return AudioBuffer<FloatType> (processBlockBuffer.getArrayOfWritePointers() + channelOffset,
666 busNumChannels, processBlockBuffer.getNumSamples());
667 }
668
669 //==============================================================================
673 bool checkBusesLayoutSupported (const BusesLayout&) const;
674
675 //==============================================================================
684 virtual bool supportsDoublePrecisionProcessing() const;
685
691 ProcessingPrecision getProcessingPrecision() const noexcept { return processingPrecision; }
692
694 bool isUsingDoublePrecision() const noexcept { return processingPrecision == doublePrecision; }
695
710 void setProcessingPrecision (ProcessingPrecision newPrecision) noexcept;
711
712 //==============================================================================
728 AudioPlayHead* getPlayHead() const noexcept { return playHead; }
729
730 //==============================================================================
743 int getTotalNumInputChannels() const noexcept { return cachedTotalIns; }
744
757 int getTotalNumOutputChannels() const noexcept { return cachedTotalOuts; }
758
760 inline int getMainBusNumInputChannels() const noexcept { return getChannelCountOfBus (true, 0); }
761
763 inline int getMainBusNumOutputChannels() const noexcept { return getChannelCountOfBus (false, 0); }
764
765 //==============================================================================
778 static bool containsLayout (const BusesLayout& layouts, const std::initializer_list<const short[2]>& channelLayoutList)
779 {
780 return containsLayout (layouts, layoutListToArray (channelLayoutList));
781 }
782
783 template <size_t numLayouts>
784 static bool containsLayout (const BusesLayout& layouts, const short (&channelLayoutList) [numLayouts][2])
785 {
786 return containsLayout (layouts, layoutListToArray (channelLayoutList));
787 }
788
800 template <size_t numLayouts>
802 const short (&channelLayoutList) [numLayouts][2])
803 {
804 return getNextBestLayoutInList (layouts, layoutListToArray (channelLayoutList));
805 }
806
807 //==============================================================================
813 double getSampleRate() const noexcept { return currentSampleRate; }
814
824 int getBlockSize() const noexcept { return blockSize; }
825
826 //==============================================================================
827
834 int getLatencySamples() const noexcept { return latencySamples; }
835
841 void setLatencySamples (int newLatency);
842
844 virtual double getTailLengthSeconds() const = 0;
845
847 virtual bool acceptsMidi() const = 0;
848
850 virtual bool producesMidi() const = 0;
851
853 virtual bool supportsMPE() const { return false; }
854
856 virtual bool isMidiEffect() const { return false; }
857
858 //==============================================================================
870 const CriticalSection& getCallbackLock() const noexcept { return callbackLock; }
871
900 void suspendProcessing (bool shouldBeSuspended);
901
905 bool isSuspended() const noexcept { return suspended; }
906
912 virtual void reset();
913
914 //==============================================================================
927 virtual AudioProcessorParameter* getBypassParameter() const { return nullptr; }
928
929 //==============================================================================
940 bool isNonRealtime() const noexcept { return nonRealtime; }
941
952 Realtime isRealtime() const noexcept
953 {
954 return isNonRealtime() ? Realtime::no : Realtime::yes;
955 }
956
960 virtual void setNonRealtime (bool isNonRealtime) noexcept;
961
962 //==============================================================================
991
996 virtual bool hasEditor() const = 0;
997
998 //==============================================================================
1005 AudioProcessorEditor* getActiveEditor() const noexcept;
1006
1010 AudioProcessorEditor* createEditorIfNeeded();
1011
1012 //==============================================================================
1020 static int getDefaultNumParameterSteps() noexcept;
1021
1027 void updateHostDisplay (const ChangeDetails& details = ChangeDetails::getDefaultFlags());
1028
1029 //==============================================================================
1035 void addParameter (AudioProcessorParameter*);
1036
1044 void addParameterGroup (std::unique_ptr<AudioProcessorParameterGroup>);
1045
1047 const AudioProcessorParameterGroup& getParameterTree() const;
1048
1057 void setParameterTree (AudioProcessorParameterGroup&& newTree);
1058
1065 virtual void refreshParameterList();
1066
1068 const Array<AudioProcessorParameter*>& getParameters() const;
1069
1070 //==============================================================================
1078 virtual int getNumPrograms() = 0;
1079
1081 virtual int getCurrentProgram() = 0;
1082
1084 virtual void setCurrentProgram (int index) = 0;
1085
1087 virtual const String getProgramName (int index) = 0;
1088
1090 virtual void changeProgramName (int index, const String& newName) = 0;
1091
1092 //==============================================================================
1105 virtual void getStateInformation (juce::MemoryBlock& destData) = 0;
1106
1118 virtual void getCurrentProgramStateInformation (juce::MemoryBlock& destData);
1119
1130 virtual void setStateInformation (const void* data, int sizeInBytes) = 0;
1131
1141 virtual void setCurrentProgramStateInformation (const void* data, int sizeInBytes);
1142
1144 virtual void numChannelsChanged();
1145
1147 virtual void numBusesChanged();
1148
1150 virtual void processorLayoutsChanged();
1151
1152 //==============================================================================
1154 virtual void addListener (AudioProcessorListener* newListener);
1155
1157 virtual void removeListener (AudioProcessorListener* listenerToRemove);
1158
1159 //==============================================================================
1164 virtual void setPlayHead (AudioPlayHead* newPlayHead);
1165
1166 //==============================================================================
1170 void setPlayConfigDetails (int numIns, int numOuts, double sampleRate, int blockSize);
1171
1178 void setRateAndBufferSizeDetails (double sampleRate, int blockSize) noexcept;
1179
1188 virtual void audioWorkgroupContextChanged ([[maybe_unused]] const AudioWorkgroup& workgroup) {}
1189
1190 //==============================================================================
1194 virtual AAXClientExtensions& getAAXClientExtensions() { return *this; }
1195
1204 virtual VST2ClientExtensions* getVST2ClientExtensions();
1205
1214 virtual VST3ClientExtensions* getVST3ClientExtensions();
1215
1216 //==============================================================================
1222 {
1223 enum class Type : int
1224 {
1225 EQ, // an EQ curve - input is in Hz, output is in dB
1226 Dynamics, // a dynamics curve - input and output is in dB
1227 GainReduction, // a gain reduction curve - input and output is in dB
1228
1229 Unknown = -1
1230 };
1231
1232 std::function<float (float)> curve; // a function which represents your curve (such as an eq)
1233 Range<float> xRange, yRange; // the data range of your curve
1234
1235 // For some curve types, your plug-in may already measure the current input and output values.
1236 // An host can use to indicate where on the curve the current signal is (for example
1237 // by putting a dot on the curve). Simply leave these strings empty if you do not want to
1238 // support this.
1239 String xMeterID, yMeterID;
1240 };
1241
1242 virtual CurveData getResponseCurve (CurveData::Type /*curveType*/) const { return {}; }
1243
1244 //==============================================================================
1246 void editorBeingDeleted (AudioProcessorEditor*) noexcept;
1247
1250 {
1251 wrapperType_Undefined = 0,
1252 wrapperType_VST,
1253 wrapperType_VST3,
1254 wrapperType_AudioUnit,
1255 wrapperType_AudioUnitv3,
1256 wrapperType_AAX,
1257 wrapperType_Standalone,
1258 wrapperType_Unity,
1259 wrapperType_LV2
1260 };
1261
1266
1268 static const char* getWrapperTypeDescription (AudioProcessor::WrapperType) noexcept;
1269
1270
1274 {
1275 String name; // The name of the track - this will be empty if the track name is not known
1276 Colour colour; // The colour of the track - this will be transparentBlack if the colour is not known
1277
1278 // other properties may be added in the future
1279 };
1280
1295 virtual void updateTrackProperties (const TrackProperties& properties);
1296
1297 //==============================================================================
1306 static void copyXmlToBinary (const XmlElement& xml,
1307 juce::MemoryBlock& destData);
1308
1312 static std::unique_ptr<XmlElement> getXmlFromBinary (const void* data, int sizeInBytes);
1313
1315 static void JUCE_CALLTYPE setTypeOfNextNewPlugin (WrapperType);
1316
1317protected:
1329 virtual bool isBusesLayoutSupported (const BusesLayout&) const { return true; }
1330
1362 virtual bool canApplyBusesLayout (const BusesLayout& layouts) const { return isBusesLayoutSupported (layouts); }
1363
1369 virtual bool applyBusLayouts (const BusesLayout& layouts);
1370
1371 //==============================================================================
1384
1387 {
1390
1393
1394 void addBus (bool isInput, const String& name, const AudioChannelSet& defaultLayout, bool isActivatedByDefault = true);
1395
1396 [[nodiscard]] BusesProperties withInput (const String& name, const AudioChannelSet& defaultLayout, bool isActivatedByDefault = true) const;
1397 [[nodiscard]] BusesProperties withOutput (const String& name, const AudioChannelSet& defaultLayout, bool isActivatedByDefault = true) const;
1398 };
1399
1424 virtual bool canApplyBusCountChange (bool isInput, bool isAddingBuses,
1425 BusProperties& outNewBusProperties);
1426
1427 //==============================================================================
1429 std::atomic<AudioPlayHead*> playHead { nullptr };
1430
1432 void sendParamChangeMessageToListeners (int parameterIndex, float newValue);
1433
1434public:
1435 #ifndef DOXYGEN
1436 // These methods are all deprecated in favour of using AudioProcessorParameter
1437 // and AudioProcessorParameterGroup
1438 [[deprecated]] virtual int getNumParameters();
1439 [[deprecated]] virtual const String getParameterName (int parameterIndex);
1440 [[deprecated]] virtual String getParameterID (int index);
1441 [[deprecated]] virtual float getParameter (int parameterIndex);
1442 [[deprecated]] virtual String getParameterName (int parameterIndex, int maximumStringLength);
1443 [[deprecated]] virtual const String getParameterText (int parameterIndex);
1444 [[deprecated]] virtual String getParameterText (int parameterIndex, int maximumStringLength);
1445 [[deprecated]] virtual int getParameterNumSteps (int parameterIndex);
1446 [[deprecated]] virtual bool isParameterDiscrete (int parameterIndex) const;
1447 [[deprecated]] virtual float getParameterDefaultValue (int parameterIndex);
1448 [[deprecated]] virtual String getParameterLabel (int index) const;
1449 [[deprecated]] virtual bool isParameterOrientationInverted (int index) const;
1450 [[deprecated]] virtual void setParameter (int parameterIndex, float newValue);
1451 [[deprecated]] virtual bool isParameterAutomatable (int parameterIndex) const;
1452 [[deprecated]] virtual bool isMetaParameter (int parameterIndex) const;
1453 [[deprecated]] virtual AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const;
1454 [[deprecated]] void beginParameterChangeGesture (int parameterIndex);
1455 [[deprecated]] void endParameterChangeGesture (int parameterIndex);
1456 [[deprecated]] void setParameterNotifyingHost (int parameterIndex, float newValue);
1457
1458 // These functions are deprecated: your audio processor can inform the host
1459 // on its bus and channel layouts and names using the AudioChannelSet and various bus classes.
1460 [[deprecated]] int getNumInputChannels() const noexcept { return getTotalNumInputChannels(); }
1461 [[deprecated]] int getNumOutputChannels() const noexcept { return getTotalNumOutputChannels(); }
1462 [[deprecated]] const String getInputSpeakerArrangement() const noexcept { return cachedInputSpeakerArrString; }
1463 [[deprecated]] const String getOutputSpeakerArrangement() const noexcept { return cachedOutputSpeakerArrString; }
1464 [[deprecated]] virtual const String getInputChannelName (int channelIndex) const;
1465 [[deprecated]] virtual const String getOutputChannelName (int channelIndex) const;
1466 [[deprecated]] virtual bool isInputChannelStereoPair (int index) const;
1467 [[deprecated]] virtual bool isOutputChannelStereoPair (int index) const;
1468 #endif
1469
1470private:
1471 //==============================================================================
1472 struct InOutChannelPair
1473 {
1474 InOutChannelPair() = default;
1475
1476 InOutChannelPair (int16 inCh, int16 outCh) noexcept : inChannels (inCh), outChannels (outCh) {}
1477 InOutChannelPair (const int16 (&config)[2]) noexcept : inChannels (config[0]), outChannels (config[1]) {}
1478
1479 bool operator== (const InOutChannelPair& other) const noexcept
1480 {
1481 return other.inChannels == inChannels && other.outChannels == outChannels;
1482 }
1483
1484 int16 inChannels = 0, outChannels = 0;
1485 };
1486
1487 template <size_t numLayouts>
1488 static Array<InOutChannelPair> layoutListToArray (const short (&configuration) [numLayouts][2])
1489 {
1490 Array<InOutChannelPair> layouts;
1491
1492 for (size_t i = 0; i < numLayouts; ++i)
1493 layouts.add (InOutChannelPair (configuration[(int) i]));
1494
1495 return layouts;
1496 }
1497
1498 static Array<InOutChannelPair> layoutListToArray (const std::initializer_list<const short[2]>& configuration)
1499 {
1500 Array<InOutChannelPair> layouts;
1501
1502 for (auto&& i : configuration)
1503 layouts.add (InOutChannelPair (i));
1504
1505 return layouts;
1506 }
1507
1508 template <typename This>
1509 static auto getBusImpl (This& t, bool isInput, int busIndex) -> decltype (t.getBus (isInput, busIndex))
1510 {
1511 return (isInput ? t.inputBuses : t.outputBuses)[busIndex];
1512 }
1513
1514 //==============================================================================
1515 static BusesProperties busesPropertiesFromLayoutArray (const Array<InOutChannelPair>&);
1516
1517 BusesLayout getNextBestLayoutInList (const BusesLayout&, const Array<InOutChannelPair>&) const;
1518 static bool containsLayout (const BusesLayout&, const Array<InOutChannelPair>&);
1519
1520 //==============================================================================
1521 void createBus (bool isInput, const BusProperties&);
1522
1523 //==============================================================================
1524 Array<AudioProcessorListener*> listeners;
1525 Component::SafePointer<AudioProcessorEditor> activeEditor;
1526 double currentSampleRate = 0;
1527 int blockSize = 0, latencySamples = 0;
1528 bool suspended = false;
1529 std::atomic<bool> nonRealtime { false };
1530 ProcessingPrecision processingPrecision = singlePrecision;
1531 CriticalSection callbackLock, listenerLock, activeEditorLock;
1532
1533 friend class Bus;
1534 mutable OwnedArray<Bus> inputBuses, outputBuses;
1535
1536 String cachedInputSpeakerArrString, cachedOutputSpeakerArrString;
1537 int cachedTotalIns = 0, cachedTotalOuts = 0;
1538
1539 AudioProcessorParameterGroup parameterTree;
1540 Array<AudioProcessorParameter*> flatParameterList;
1541
1542 AudioProcessorParameter* getParamChecked (int) const;
1543
1544 #if JUCE_DEBUG
1545 #if ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
1546 BigInteger changingParams;
1547 #endif
1548
1549 bool textRecursionCheck = false;
1550 std::unordered_set<String> paramIDs, groupIDs;
1551 #if ! JUCE_DISABLE_CAUTIOUS_PARAMETER_ID_CHECKING
1552 std::unordered_set<String> trimmedParamIDs;
1553 #endif
1554 #endif
1555
1556 void checkForDuplicateTrimmedParamID (AudioProcessorParameter*);
1557 void validateParameter (AudioProcessorParameter*);
1558 void checkForDuplicateParamID (AudioProcessorParameter*);
1559 void checkForDuplicateGroupIDs (const AudioProcessorParameterGroup&);
1560
1561 AudioProcessorListener* getListenerLocked (int) const noexcept;
1562 void updateSpeakerFormatStrings();
1563 void audioIOChanged (bool busNumberChanged, bool channelNumChanged);
1564 void getNextBestLayout (const BusesLayout&, BusesLayout&) const;
1565
1566 template <typename floatType>
1567 void processBypassed (AudioBuffer<floatType>&, MidiBuffer&);
1568
1569 friend class AudioProcessorParameter;
1570 friend class LADSPAPluginInstance;
1571
1572 [[deprecated ("This method is no longer used - you can delete it from your AudioProcessor classes.")]]
1573 virtual bool silenceInProducesSilenceOut() const { return false; }
1574
1576};
1577
1578} // namespace juce
Holds a resizable array of primitive or copy-by-value objects.
Definition juce_Array.h:56
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.
Type *const * getArrayOfWritePointers() noexcept
Returns an array of pointers to the channels in the buffer.
Represents a set of audio channel types.
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.
A class encapsulating a group of AudioProcessorParameters and nested AudioProcessorParameterGroups.
An abstract base class for parameter objects that can be added to an AudioProcessor.
Describes the layout and properties of an audio bus.
const AudioChannelSet & getCurrentLayout() const noexcept
The bus's current layout.
const AudioChannelSet & getDefaultLayout() const noexcept
Get the default layout of this bus.
int getNumberOfChannels() const noexcept
Return the number of channels of the current bus.
const String & getName() const noexcept
The bus's name.
bool isEnabledByDefault() const noexcept
Returns if this bus is enabled by default.
AudioBuffer< FloatType > getBusBuffer(AudioBuffer< FloatType > &processBlockBuffer) const
Returns an AudioBuffer containing a set of channel pointers for a specific bus.
bool isMain() const noexcept
Returns true if the current bus is the main input or output bus.
bool isEnabled() const noexcept
Returns true if the current bus is enabled.
const AudioChannelSet & getLastEnabledLayout() const noexcept
Return the bus's last active channel layout.
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.
bool isNonRealtime() const noexcept
Returns true if the processor is being run in an offline mode for rendering.
virtual AAXClientExtensions & getAAXClientExtensions()
Returns a reference to an object that implements AAX specific information regarding this AudioProcess...
virtual bool acceptsMidi() const =0
Returns true if the processor wants MIDI messages.
WrapperType
Flags to indicate the type of plugin context in which a processor is being used.
Bus * getBus(bool isInput, int busIndex) noexcept
Returns the audio bus with a given index and direction.
bool isUsingDoublePrecision() const noexcept
Returns true if the current precision is set to doublePrecision.
const WrapperType wrapperType
When loaded by a plugin wrapper, this flag will be set to indicate the type of plugin within which th...
int getLatencySamples() const noexcept
This returns the number of samples delay that the processor imposes on the audio passing through it.
virtual void memoryWarningReceived()
Called by the host to indicate that you should reduce your memory footprint.
ProcessingPrecision getProcessingPrecision() const noexcept
Returns the precision-mode of the processor.
AudioChannelSet defaultLayout
The default layout of the bus.
virtual void prepareToPlay(double sampleRate, int maximumExpectedSamplesPerBlock)=0
Called before playback starts, to let the processor prepare itself.
virtual AudioProcessorParameter * getBypassParameter() const
Returns the parameter that controls the AudioProcessor's bypass state.
virtual AudioProcessorEditor * createEditor()=0
Creates the processor's GUI.
AudioProcessor(const std::initializer_list< const short[2]> &channelLayoutList)
Constructor for AudioProcessors which use layout maps If your AudioProcessor uses layout maps then us...
BusesLayout getNextBestLayoutInLayoutList(const BusesLayout &layouts, const short(&channelLayoutList)[numLayouts][2])
Returns the next best layout which is contained in a channel layout map.
Realtime isRealtime() const noexcept
Returns no if the processor is being run in an offline mode for rendering.
virtual void processBlock(AudioBuffer< float > &buffer, MidiBuffer &midiMessages)=0
Renders the next block.
bool isActivatedByDefault
Is this bus activated by default?
const CriticalSection & getCallbackLock() const noexcept
This returns a critical section that will automatically be locked while the host is calling the proce...
virtual const String getName() const =0
Returns the name of this processor.
bool isSuspended() const noexcept
Returns true if processing is currently suspended.
int getChannelCountOfBus(bool isInput, int busIndex) const noexcept
Provides the number of channels of the bus with a given index and direction.
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 bool supportsMPE() const
Returns true if the processor supports MPE.
virtual double getTailLengthSeconds() const =0
Returns the length of the processor's tail, in seconds.
virtual bool isBusesLayoutSupported(const BusesLayout &) const
Callback to query if the AudioProcessor supports a specific layout.
double getSampleRate() const noexcept
Returns the current sample rate.
int getTotalNumOutputChannels() const noexcept
Returns the total number of output channels.
virtual bool producesMidi() const =0
Returns true if the processor produces MIDI messages.
AudioPlayHead * getPlayHead() const noexcept
Returns the current AudioPlayHead object that should be used to find out the state and position of th...
virtual bool isMidiEffect() const
Returns true if this is a MIDI effect plug-in and does no audio processing.
int getMainBusNumInputChannels() const noexcept
Returns the number of input channels on the main bus.
int getMainBusNumOutputChannels() const noexcept
Returns the number of output channels on the main bus.
int getBlockSize() const noexcept
Returns the current typical block size that is being used.
AudioBuffer< FloatType > getBusBuffer(AudioBuffer< FloatType > &processBlockBuffer, bool isInput, int busIndex) const
Returns an AudioBuffer containing a set of channel pointers for a specific bus.
const Bus * getBus(bool isInput, int busIndex) const noexcept
Returns the audio bus with a given index and direction.
virtual void releaseResources()=0
Called after playback has stopped, to let the object free up any resources it no longer needs.
Structure used for AudioProcessor Callbacks.
A struct containing information about the DAW track inside which your AudioProcessor is loaded.
A handle to an audio workgroup, which is a collection of realtime threads working together to produce...
Represents a colour, also including a transparency value.
Definition juce_Colour.h:38
A class to hold a resizable block of raw data.
Holds a sequence of time-stamped midi events.
A general-purpose range object, that simply represents any linear range with a start and end point.
Definition juce_Range.h:40
A special array for holding a list of strings.
The JUCE String class!
Definition juce_String.h:53
Used to build a tree of elements representing an XML document.
#define JUCE_DECLARE_NON_COPYABLE(className)
This is a shorthand macro for deleting a class's copy constructor and copy assignment operator.
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for ...
#define jassertfalse
This will always cause an assertion failure.
#define JUCE_CALLTYPE
This macro defines the C calling convention used as the standard for JUCE calls.
typedef float
JUCE Namespace.
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Returns true if a value is at least zero, and also below a specified upper limit.
An interface to allow an AudioProcessor to implement extended AAX-specific functionality.
Provides details about aspects of an AudioProcessor which have changed.
Represents the bus layout state of a plug-in.
int getMainInputChannels() const noexcept
Get the number of input channels on the main bus.
AudioChannelSet getMainInputChannelSet() const noexcept
Get the input channel layout on the main bus.
AudioChannelSet getMainOutputChannelSet() const noexcept
Get the output channel layout on the main bus.
Array< AudioChannelSet > outputBuses
An array containing the list of output buses that this processor supports.
AudioChannelSet getChannelSet(bool isInput, int busIndex) const noexcept
Get the channel set of a particular bus.
int getMainOutputChannels() const noexcept
Get the number of output channels on the main bus.
int getNumChannels(bool isInput, int busIndex) const noexcept
Get the number of channels of a particular bus.
Array< AudioChannelSet > inputBuses
An array containing the list of input buses that this processor supports.
AudioChannelSet & getChannelSet(bool isInput, int busIndex) noexcept
Get the channel set of a particular bus.
Structure used for AudioProcessor Callbacks.
Array< BusProperties > outputLayouts
The layouts of the output buses.
Array< BusProperties > inputLayouts
The layouts of the input buses.
Some plug-ins support sharing response curve data with the host so that it can display this curve on ...
An interface to allow an AudioProcessor to implement extended VST2-specific functionality.
An interface to allow an AudioProcessor to implement extended VST3-specific functionality.