LMMS
Loading...
Searching...
No Matches
juce_VST3Common.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
26#pragma once
27
28#ifndef DOXYGEN
29
30namespace juce
31{
32
34
35//==============================================================================
36#define JUCE_DECLARE_VST3_COM_REF_METHODS \
37 Steinberg::uint32 PLUGIN_API addRef() override { return (Steinberg::uint32) ++refCount; } \
38 Steinberg::uint32 PLUGIN_API release() override { const int r = --refCount; if (r == 0) delete this; return (Steinberg::uint32) r; }
39
40#define JUCE_DECLARE_VST3_COM_QUERY_METHODS \
41 Steinberg::tresult PLUGIN_API queryInterface (const Steinberg::TUID, void** obj) override \
42 { \
43 jassertfalse; \
44 *obj = nullptr; \
45 return Steinberg::kNotImplemented; \
46 }
47
48inline bool doUIDsMatch (const Steinberg::TUID a, const Steinberg::TUID b) noexcept
49{
50 return std::memcmp (a, b, sizeof (Steinberg::TUID)) == 0;
51}
52
53/* Holds a tresult and a pointer to an object.
54
55 Useful for holding intermediate results of calls to queryInterface.
56*/
58{
59public:
61
63 : result (resultIn), ptr (ptrIn) {}
64
66
67 Steinberg::tresult extract (void** obj) const
68 {
69 *obj = result == Steinberg::kResultOk ? ptr : nullptr;
70 return result;
71 }
72
73private:
75 void* ptr = nullptr;
76};
77
78/* Holds a tresult and a pointer to an object.
79
80 Calling InterfaceResultWithDeferredAddRef::extract() will also call addRef
81 on the pointed-to object. It is expected that users will use
82 InterfaceResultWithDeferredAddRef to hold intermediate results of a queryInterface
83 call. When a suitable interface is found, the function can be exited with
84 `return suitableInterface.extract (obj)`, which will set the obj pointer,
85 add a reference to the interface, and return the appropriate result code.
86*/
88{
89public:
91
92 template <typename Ptr>
94 : result (resultIn, ptrIn),
95 addRefFn (doAddRef<Ptr>) {}
96
97 bool isOk() const noexcept { return result.isOk(); }
98
99 Steinberg::tresult extract (void** obj) const
100 {
101 const auto toReturn = result.extract (obj);
102
103 if (result.isOk() && addRefFn != nullptr && *obj != nullptr)
104 addRefFn (*obj);
105
106 return toReturn;
107 }
108
109private:
110 template <typename Ptr>
111 static void doAddRef (void* obj) { static_cast<Ptr*> (obj)->addRef(); }
112
114 void (*addRefFn) (void*) = nullptr;
115};
116
117template <typename ClassType> struct UniqueBase {};
118template <typename CommonClassType, typename SourceClassType> struct SharedBase {};
119
120template <typename ToTest, typename CommonClassType, typename SourceClassType>
122 const Steinberg::TUID targetIID,
124{
125 if (! doUIDsMatch (targetIID, CommonClassType::iid))
126 return {};
127
128 return { Steinberg::kResultOk, static_cast<CommonClassType*> (static_cast<SourceClassType*> (std::addressof (toTest))) };
129}
130
131template <typename ToTest, typename ClassType>
133 const Steinberg::TUID targetIID,
135{
136 return testFor (toTest, targetIID, SharedBase<ClassType, ClassType>{});
137}
138
139template <typename ToTest>
141
142template <typename ToTest, typename Head, typename... Tail>
143InterfaceResultWithDeferredAddRef testForMultiple (ToTest& toTest, const Steinberg::TUID targetIID, Head head, Tail... tail)
144{
145 const auto result = testFor (toTest, targetIID, head);
146
147 if (result.isOk())
148 return result;
149
150 return testForMultiple (toTest, targetIID, tail...);
151}
152
153//==============================================================================
154#if VST_VERSION < 0x030608
155 #define kAmbi1stOrderACN kBFormat
156#endif
157
158//==============================================================================
159inline juce::String toString (const Steinberg::char8* string) noexcept { return juce::String (juce::CharPointer_UTF8 ((juce::CharPointer_UTF8::CharType*) string)); }
160inline juce::String toString (const Steinberg::char16* string) noexcept { return juce::String (juce::CharPointer_UTF16 ((juce::CharPointer_UTF16::CharType*) string)); }
161
162// NB: The casts are handled by a Steinberg::UString operator
163inline juce::String toString (const Steinberg::UString128& string) noexcept { return toString (static_cast<const Steinberg::char16*> (string)); }
164inline juce::String toString (const Steinberg::UString256& string) noexcept { return toString (static_cast<const Steinberg::char16*> (string)); }
165
166inline Steinberg::Vst::TChar* toString (const juce::String& source) noexcept { return reinterpret_cast<Steinberg::Vst::TChar*> (source.toUTF16().getAddress()); }
167
168inline void toString128 (Steinberg::Vst::String128 result, const char* source)
169{
170 Steinberg::UString (result, 128).fromAscii (source);
171}
172
173inline void toString128 (Steinberg::Vst::String128 result, const juce::String& source)
174{
175 Steinberg::UString (result, 128).assign (toString (source));
176}
177
178#if JUCE_WINDOWS
179 static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeHWND;
180#elif JUCE_MAC
181 static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeNSView;
182#elif JUCE_LINUX || JUCE_BSD
183 static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeX11EmbedWindowID;
184#endif
185
186
187//==============================================================================
189 bool isInput, int busIndex)
190{
192
193 if (processor != nullptr)
195 (Steinberg::int32) busIndex, arrangement);
196
197 return arrangement;
198}
199
201{
202 switch (type)
203 {
207
216 case AudioChannelSet::topMiddle: return Steinberg::Vst::kSpeakerTc; /* kSpeakerTm */
254
256
280 break;
281 }
282
283 auto channelIndex = static_cast<Steinberg::Vst::Speaker> (type) - (static_cast<Steinberg::Vst::Speaker> (AudioChannelSet::discreteChannel0) + 6ull);
284 return (1ull << (channelIndex + 33ull /* last speaker in vst layout + 1 */));
285}
286
288{
289 switch (type)
290 {
302 case Steinberg::Vst::kSpeakerTc: return AudioChannelSet::topMiddle; /* kSpeakerTm */
341 }
342
343 auto channelType = BigInteger (static_cast<int64> (type)).findNextSetBit (0);
344
345 // VST3 <-> JUCE layout conversion error: report this bug to the JUCE forum
346 jassert (channelType >= 33);
347
348 return static_cast<AudioChannelSet::ChannelType> (static_cast<int> (AudioChannelSet::discreteChannel0) + 6 + (channelType - 33));
349}
350
351namespace detail
352{
354 {
356 std::initializer_list<AudioChannelSet::ChannelType> channelOrder;
357 };
358
359 using namespace Steinberg::Vst::SpeakerArr;
361
362 /* Maps VST3 layouts to the equivalent JUCE channels, in VST3 order.
363
364 The channel types are taken from the equivalent JUCE AudioChannelSet, and then reordered to
365 match the VST3 speaker positions.
366 */
368 {
369 { kEmpty, {} },
370 { kMono, { X::centre } },
371 { kStereo, { X::left, X::right } },
386
395
396 // The VST3 layout uses 'left/right' and 'left-of-center/right-of-center', but the JUCE layout uses 'left/right' and 'wide-left/wide-right'.
399 };
400
401 #if JUCE_DEBUG
402 static std::once_flag layoutTableCheckedFlag;
403 #endif
404}
405
407{
408 for (const auto& item : detail::layoutTable)
409 if ((size_t) countNumberOfBits (item.arrangement) != item.channelOrder.size())
410 return false;
411
412 std::set<Steinberg::Vst::SpeakerArrangement> arrangements;
413
414 for (const auto& item : detail::layoutTable)
415 arrangements.insert (item.arrangement);
416
417 if (arrangements.size() != (size_t) numElementsInArray (detail::layoutTable))
418 return false; // There's a duplicate speaker arrangement
419
420 return std::all_of (std::begin (detail::layoutTable), std::end (detail::layoutTable), [] (const auto& item)
421 {
422 return std::set<AudioChannelSet::ChannelType> (item.channelOrder).size() == item.channelOrder.size();
423 });
424}
425
427{
428 using namespace Steinberg::Vst;
429 using namespace Steinberg::Vst::SpeakerArr;
430
431 #if JUCE_DEBUG
432 std::call_once (detail::layoutTableCheckedFlag, [] { jassert (isLayoutTableValid()); });
433 #endif
434
435 // Check if this is a layout with a hard-coded conversion
436 const auto arrangementMatches = [arr] (const auto& layoutPair) { return layoutPair.arrangement == arr; };
437 const auto iter = std::find_if (std::begin (detail::layoutTable), std::end (detail::layoutTable), arrangementMatches);
438
439 if (iter != std::end (detail::layoutTable))
440 return iter->channelOrder;
441
442 // There's no hard-coded conversion, so assume that the channels are in the same orders in both layouts.
443 const auto channels = getChannelCount (arr);
445 result.ensureStorageAllocated (channels);
446
447 for (auto i = 0; i < channels; ++i)
448 result.add (getChannelType (arr, getSpeaker (arr, i)));
449
450 return result;
451}
452
454{
455 using namespace Steinberg::Vst::SpeakerArr;
456
457 #if JUCE_DEBUG
458 std::call_once (detail::layoutTableCheckedFlag, [] { jassert (isLayoutTableValid()); });
459 #endif
460
461 const auto channelSetMatches = [&channels] (const auto& layoutPair)
462 {
463 return AudioChannelSet::channelSetWithChannels (layoutPair.channelOrder) == channels;
464 };
465 const auto iter = std::find_if (std::begin (detail::layoutTable), std::end (detail::layoutTable), channelSetMatches);
466
467 if (iter != std::end (detail::layoutTable))
468 return iter->arrangement;
469
471
472 for (const auto& type : channels.getChannelTypes())
473 result |= getSpeakerType (channels, type);
474
475 return result;
476}
477
479{
480 using namespace Steinberg::Vst::SpeakerArr;
481
483
484 // VST3 <-> JUCE layout conversion error: report this bug to the JUCE forum
485 jassert (result.size() == getChannelCount (arr));
486
487 return result;
488}
489
490//==============================================================================
491/*
492 Provides fast remapping of the channels on a single bus, from VST3 order to JUCE order.
493
494 For multi-bus plugins, you'll need several instances of this, one per bus.
495*/
497{
498 ChannelMapping (const AudioChannelSet& layout, bool activeIn)
499 : indices (makeChannelIndices (layout)), active (activeIn) {}
500
501 explicit ChannelMapping (const AudioChannelSet& layout)
502 : ChannelMapping (layout, true) {}
503
505 : ChannelMapping (bus.getLastEnabledLayout(), bus.isEnabled()) {}
506
507 int getJuceChannelForVst3Channel (int vst3Channel) const { return indices[(size_t) vst3Channel]; }
508
509 size_t size() const { return indices.size(); }
510
511 void setActive (bool x) { active = x; }
512 bool isActive() const { return active; }
513
514private:
515 /* Builds a table that provides the index of the corresponding JUCE channel, given a VST3 channel.
516
517 Depending on the mapping, the VST3 arrangement and JUCE arrangement may not contain channels
518 that map 1:1 via getChannelType. For example, the VST3 7.1 layout contains
519 'kSpeakerLs' which maps to the 'leftSurround' channel type, but the JUCE 7.1 layout does not
520 contain this channel type. As a result, we need to try to map the channels sensibly, even
521 if there's not a 'direct' mapping.
522 */
523 static std::vector<int> makeChannelIndices (const AudioChannelSet& juceArrangement)
524 {
525 const auto order = getSpeakerOrder (getVst3SpeakerArrangement (juceArrangement));
526
527 std::vector<int> result;
528
529 for (const auto& type : order)
530 result.push_back (juceArrangement.getChannelIndexForType (type));
531
532 return result;
533 }
534
535 std::vector<int> indices;
536 bool active = true;
537};
538
540{
541public:
542 DynamicChannelMapping (const AudioChannelSet& channelSet, bool active)
543 : set (channelSet), map (channelSet, active) {}
544
545 explicit DynamicChannelMapping (const AudioChannelSet& channelSet)
546 : DynamicChannelMapping (channelSet, true) {}
547
549 : DynamicChannelMapping (bus.getLastEnabledLayout(), bus.isEnabled()) {}
550
552 int getJuceChannelForVst3Channel (int vst3Channel) const { return map.getJuceChannelForVst3Channel (vst3Channel); }
553 size_t size() const { return map.size(); }
554
555 /* Returns true if the host has activated this bus. */
556 bool isHostActive() const { return hostActive; }
557 /* Returns true if the AudioProcessor expects this bus to be active. */
558 bool isClientActive() const { return map.isActive(); }
559
560 void setHostActive (bool active) { hostActive = active; }
561 void setClientActive (bool active) { map.setActive (active); }
562
563private:
566 bool hostActive = false;
567};
568
569//==============================================================================
572
573static inline int countUsedClientChannels (const std::vector<DynamicChannelMapping>& inputMap,
574 const std::vector<DynamicChannelMapping>& outputMap)
575{
576 const auto countUsedChannelsInVector = [] (const std::vector<DynamicChannelMapping>& map)
577 {
578 return std::accumulate (map.begin(), map.end(), 0, [] (auto acc, const auto& item)
579 {
580 return acc + (item.isClientActive() ? (int) item.size() : 0);
581 });
582 };
583
584 return jmax (countUsedChannelsInVector (inputMap), countUsedChannelsInVector (outputMap));
585}
586
587template <typename FloatType>
589{
590public:
591 void setSize (int numChannels, int blockSize)
592 {
593 buffer.setSize (numChannels, blockSize);
594 }
595
596 void clear() { channelCounter = 0; }
597
598 auto* getNextChannelBuffer() { return buffer.getWritePointer (channelCounter++); }
599
600 auto getArrayOfWritePointers() { return buffer.getArrayOfWritePointers(); }
601
602private:
605};
606
607template <typename FloatType>
609{
610 return (int) std::distance (buffers, std::find_if (buffers, buffers + num, [] (auto& buf)
611 {
612 return getAudioBusPointer (detail::Tag<FloatType>{}, buf) == nullptr && buf.numChannels > 0;
613 }));
614}
615
616template <typename FloatType, typename Iterator>
617static bool validateLayouts (Iterator first, Iterator last, const std::vector<DynamicChannelMapping>& map)
618{
619 if ((size_t) std::distance (first, last) > map.size())
620 return false;
621
622 auto mapIterator = map.begin();
623
624 for (auto it = first; it != last; ++it, ++mapIterator)
625 {
626 auto** busPtr = getAudioBusPointer (detail::Tag<FloatType>{}, *it);
627 const auto anyChannelIsNull = std::any_of (busPtr, busPtr + it->numChannels, [] (auto* ptr) { return ptr == nullptr; });
628
629 // Null channels are allowed if the bus is inactive
630 if ((mapIterator->isHostActive() && anyChannelIsNull) || ((int) mapIterator->size() != it->numChannels))
631 return false;
632 }
633
634 // If the host didn't provide the full complement of buses, it must be because the other
635 // buses are all deactivated.
636 return std::none_of (mapIterator, map.end(), [] (const auto& item) { return item.isHostActive(); });
637}
638
639/*
640 The main purpose of this class is to remap a set of buffers provided by the VST3 host into an
641 equivalent JUCE AudioBuffer using the JUCE channel layout/order.
642
643 An instance of this class handles input and output remapping for a single data type (float or
644 double), matching the FloatType template parameter.
645
646 This is in VST3Common.h, rather than in the VST3_Wrapper.cpp, so that we can test it.
647
648 @see ClientBufferMapper
649*/
650template <typename FloatType>
652{
653public:
654 void prepare (int numChannels, int blockSize)
655 {
656 scratchBuffer.setSize (numChannels, blockSize);
657 channels.reserve ((size_t) jmin (128, numChannels));
658 }
659
661 const std::vector<DynamicChannelMapping>& inputMap,
662 const std::vector<DynamicChannelMapping>& outputMap)
663 {
664 scratchBuffer.clear();
665 channels.clear();
666
667 const auto usedChannels = countUsedClientChannels (inputMap, outputMap);
668
669 // WaveLab workaround: This host may report the wrong number of inputs/outputs so re-count here
670 const auto vstInputs = countValidBuses<FloatType> (data.inputs, data.numInputs);
671
672 if (! validateLayouts<FloatType> (data.inputs, data.inputs + vstInputs, inputMap))
673 return getBlankBuffer (usedChannels, (int) data.numSamples);
674
675 setUpInputChannels (data, (size_t) vstInputs, scratchBuffer, inputMap, channels);
677
678 const auto channelPtr = channels.empty() ? scratchBuffer.getArrayOfWritePointers()
679 : channels.data();
680
681 return { channelPtr, (int) channels.size(), (int) data.numSamples };
682 }
683
684private:
686 size_t vstInputs,
688 const std::vector<DynamicChannelMapping>& map,
689 std::vector<FloatType*>& channels)
690 {
691 for (size_t busIndex = 0; busIndex < map.size(); ++busIndex)
692 {
693 const auto mapping = map[busIndex];
694
695 if (! mapping.isClientActive())
696 continue;
697
698 const auto originalSize = channels.size();
699
700 for (size_t channelIndex = 0; channelIndex < mapping.size(); ++channelIndex)
701 channels.push_back (scratchBuffer.getNextChannelBuffer());
702
703 if (mapping.isHostActive() && busIndex < vstInputs)
704 {
705 auto** busPtr = getAudioBusPointer (detail::Tag<FloatType>{}, data.inputs[busIndex]);
706
707 for (size_t channelIndex = 0; channelIndex < mapping.size(); ++channelIndex)
708 {
709 FloatVectorOperations::copy (channels[(size_t) mapping.getJuceChannelForVst3Channel ((int) channelIndex) + originalSize],
710 busPtr[channelIndex],
711 (size_t) data.numSamples);
712 }
713 }
714 else
715 {
716 for (size_t channelIndex = 0; channelIndex < mapping.size(); ++channelIndex)
717 FloatVectorOperations::clear (channels[originalSize + channelIndex], (size_t) data.numSamples);
718 }
719 }
720 }
721
723 const std::vector<DynamicChannelMapping>& map,
724 std::vector<FloatType*>& channels)
725 {
726 for (size_t i = 0, initialBusIndex = 0; i < (size_t) map.size(); ++i)
727 {
728 const auto& mapping = map[i];
729
730 if (mapping.isClientActive())
731 {
732 for (size_t j = 0; j < mapping.size(); ++j)
733 {
734 if (channels.size() <= initialBusIndex + j)
735 channels.push_back (scratchBuffer.getNextChannelBuffer());
736 }
737
738 initialBusIndex += mapping.size();
739 }
740 }
741 }
742
743 AudioBuffer<FloatType> getBlankBuffer (int usedChannels, int usedSamples)
744 {
745 // The host is ignoring the bus layout we requested, so we can't process sensibly!
747
748 // Return a silent buffer for the AudioProcessor to process
749 for (auto i = 0; i < usedChannels; ++i)
750 {
751 channels.push_back (scratchBuffer.getNextChannelBuffer());
752 FloatVectorOperations::clear (channels.back(), usedSamples);
753 }
754
755 return { channels.data(), (int) channels.size(), usedSamples };
756 }
757
758 std::vector<FloatType*> channels;
760};
761
762//==============================================================================
763/*
764 Remaps a set of buffers provided by the VST3 host into an equivalent JUCE AudioBuffer using the
765 JUCE channel layout/order.
766
767 An instance of this class can remap to either a float or double JUCE buffer, as necessary.
768
769 Although the VST3 spec requires that the bus layout does not change while the plugin is
770 activated and processing, some hosts get this wrong and try to enable/disable buses during
771 playback. This class attempts to be resilient, and should cope with buses being switched on and
772 off during processing.
773
774 This is in VST3Common.h, rather than in the VST3_Wrapper.cpp, so that we can test it.
775
776 @see ClientBufferMapper
777*/
779{
780public:
781 void updateFromProcessor (const AudioProcessor& processor)
782 {
783 struct Pair
784 {
785 std::vector<DynamicChannelMapping>& map;
786 bool isInput;
787 };
788
789 for (const auto& pair : { Pair { inputMap, true }, Pair { outputMap, false } })
790 {
791 if (pair.map.empty())
792 {
793 for (auto i = 0; i < processor.getBusCount (pair.isInput); ++i)
794 pair.map.emplace_back (*processor.getBus (pair.isInput, i));
795 }
796 else
797 {
798 // The number of buses cannot change after creating a VST3 plugin!
799 jassert ((size_t) processor.getBusCount (pair.isInput) == pair.map.size());
800
801 for (size_t i = 0; i < (size_t) processor.getBusCount (pair.isInput); ++i)
802 {
803 pair.map[i] = [&]
804 {
805 DynamicChannelMapping replacement { *processor.getBus (pair.isInput, (int) i) };
806 replacement.setHostActive (pair.map[i].isHostActive());
807 return replacement;
808 }();
809 }
810 }
811 }
812 }
813
814 void prepare (int blockSize)
815 {
816 const auto findNumChannelsWhenAllBusesEnabled = [] (const auto& map)
817 {
818 return std::accumulate (map.cbegin(), map.cend(), 0, [] (auto acc, const auto& item)
819 {
820 return acc + (int) item.size();
821 });
822 };
823
824 const auto numChannels = jmax (findNumChannelsWhenAllBusesEnabled (inputMap),
825 findNumChannelsWhenAllBusesEnabled (outputMap));
826
827 floatData .prepare (numChannels, blockSize);
828 doubleData.prepare (numChannels, blockSize);
829 }
830
832 {
833 if ( (size_t) clientBuses.inputBuses .size() != inputMap .size()
834 || (size_t) clientBuses.outputBuses.size() != outputMap.size())
835 {
837 return;
838 }
839
840 const auto sync = [] (auto& map, auto& client)
841 {
842 for (size_t i = 0; i < map.size(); ++i)
843 {
844 jassert (client[(int) i] == AudioChannelSet::disabled() || client[(int) i] == map[i].getAudioChannelSet());
845 map[i].setClientActive (client[(int) i] != AudioChannelSet::disabled());
846 }
847 };
848
849 sync (inputMap, clientBuses.inputBuses);
850 sync (outputMap, clientBuses.outputBuses);
851 }
852
853 void setInputBusHostActive (size_t bus, bool state) { setHostActive (inputMap, bus, state); }
854 void setOutputBusHostActive (size_t bus, bool state) { setHostActive (outputMap, bus, state); }
855
858
860 {
862 }
863
865 {
867 }
868
869 const std::vector<DynamicChannelMapping>& getInputMap() const { return inputMap; }
870 const std::vector<DynamicChannelMapping>& getOutputMap() const { return outputMap; }
871
872private:
873 static void setHostActive (std::vector<DynamicChannelMapping>& map, size_t bus, bool state)
874 {
875 if (bus < map.size())
876 map[bus].setHostActive (state);
877 }
878
879 static AudioChannelSet getRequestedLayoutForBus (const std::vector<DynamicChannelMapping>& map, size_t bus)
880 {
881 if (bus < map.size() && map[bus].isHostActive())
882 return map[bus].getAudioChannelSet();
883
885 }
886
889
890 std::vector<DynamicChannelMapping> inputMap;
891 std::vector<DynamicChannelMapping> outputMap;
892};
893
894//==============================================================================
895/* Holds a buffer in the JUCE channel layout, and a reference to a Vst ProcessData struct, and
896 copies each JUCE channel to the appropriate host output channel when this object goes
897 out of scope.
898*/
899template <typename FloatType>
901{
902public:
904 const std::vector<DynamicChannelMapping>* inputMapIn,
905 const std::vector<DynamicChannelMapping>* outputMapIn,
907 : buffer (mapperData.getMappedBuffer (hostData, *inputMapIn, *outputMapIn)),
908 outputMap (outputMapIn),
909 data (hostData)
910 {}
911
913 : ClientRemappedBuffer (mapperIn.getData (detail::Tag<FloatType>{}),
914 &mapperIn.getInputMap(),
915 &mapperIn.getOutputMap(),
916 hostData)
917 {}
918
920 {
921 // WaveLab workaround: This host may report the wrong number of inputs/outputs so re-count here
922 const auto vstOutputs = (size_t) countValidBuses<FloatType> (data.outputs, data.numOutputs);
923
924 if (validateLayouts<FloatType> (data.outputs, data.outputs + vstOutputs, *outputMap))
925 copyToHostOutputBuses (vstOutputs);
926 else
927 clearHostOutputBuses (vstOutputs);
928 }
929
931
932private:
933 void copyToHostOutputBuses (size_t vstOutputs) const
934 {
935 for (size_t i = 0, juceBusOffset = 0; i < outputMap->size(); ++i)
936 {
937 const auto& mapping = (*outputMap)[i];
938
939 if (mapping.isHostActive() && i < vstOutputs)
940 {
941 auto& bus = data.outputs[i];
942
943 if (mapping.isClientActive())
944 {
945 for (size_t j = 0; j < mapping.size(); ++j)
946 {
947 auto* hostChannel = getAudioBusPointer (detail::Tag<FloatType>{}, bus)[j];
948 const auto juceChannel = juceBusOffset + (size_t) mapping.getJuceChannelForVst3Channel ((int) j);
949 FloatVectorOperations::copy (hostChannel, buffer.getReadPointer ((int) juceChannel), (size_t) data.numSamples);
950 }
951 }
952 else
953 {
954 for (size_t j = 0; j < mapping.size(); ++j)
955 {
956 auto* hostChannel = getAudioBusPointer (detail::Tag<FloatType>{}, bus)[j];
957 FloatVectorOperations::clear (hostChannel, (size_t) data.numSamples);
958 }
959 }
960 }
961
962 if (mapping.isClientActive())
963 juceBusOffset += mapping.size();
964 }
965 }
966
967 void clearHostOutputBuses (size_t vstOutputs) const
968 {
969 // The host provided us with an unexpected bus layout.
971
972 std::for_each (data.outputs, data.outputs + vstOutputs, [this] (auto& bus)
973 {
974 auto** busPtr = getAudioBusPointer (detail::Tag<FloatType>{}, bus);
975 std::for_each (busPtr, busPtr + bus.numChannels, [this] (auto* ptr)
976 {
977 if (ptr != nullptr)
978 FloatVectorOperations::clear (ptr, (int) data.numSamples);
979 });
980 });
981 }
982
983 const std::vector<DynamicChannelMapping>* outputMap = nullptr;
985
988};
989
990//==============================================================================
991/*
992 Remaps a JUCE buffer to an equivalent VST3 layout.
993
994 An instance of this class handles mappings for both float and double buffers, but in a single
995 direction (input or output).
996*/
998{
999public:
1000 /* Builds a cached map of juce <-> vst3 channel mappings. */
1001 void prepare (std::vector<ChannelMapping> arrangements)
1002 {
1003 mappings = std::move (arrangements);
1004
1005 floatBusMap .resize (mappings.size());
1006 doubleBusMap.resize (mappings.size());
1007 busBuffers .resize (mappings.size());
1008 }
1009
1010 /* Applies the mapping to an AudioBuffer using JUCE channel layout. */
1011 template <typename FloatType>
1013 {
1014 int channelIndexOffset = 0;
1015
1016 for (size_t i = 0; i < mappings.size(); ++i)
1017 {
1018 const auto& mapping = mappings[i];
1019 associateBufferTo (busBuffers[i], get (detail::Tag<FloatType>{})[i], source, mapping, channelIndexOffset);
1020 channelIndexOffset += mapping.isActive() ? (int) mapping.size() : 0;
1021 }
1022
1023 return busBuffers.data();
1024 }
1025
1026private:
1027 template <typename FloatType>
1028 using Bus = std::vector<FloatType*>;
1029
1030 template <typename FloatType>
1031 using BusMap = std::vector<Bus<FloatType>>;
1032
1033 static void assignRawPointer (Steinberg::Vst::AudioBusBuffers& vstBuffers, float** raw) { vstBuffers.channelBuffers32 = raw; }
1034 static void assignRawPointer (Steinberg::Vst::AudioBusBuffers& vstBuffers, double** raw) { vstBuffers.channelBuffers64 = raw; }
1035
1036 template <typename FloatType>
1038 Bus<FloatType>& bus,
1039 AudioBuffer<FloatType>& buffer,
1040 const ChannelMapping& busMap,
1041 int channelStartOffset) const
1042 {
1043 bus.clear();
1044
1045 for (size_t i = 0; i < busMap.size(); ++i)
1046 {
1047 bus.push_back (busMap.isActive() ? buffer.getWritePointer (channelStartOffset + busMap.getJuceChannelForVst3Channel ((int) i))
1048 : nullptr);
1049 }
1050
1051 assignRawPointer (vstBuffers, bus.data());
1052 vstBuffers.numChannels = (Steinberg::int32) busMap.size();
1053 vstBuffers.silenceFlags = busMap.isActive() ? 0 : std::numeric_limits<Steinberg::uint64>::max();
1054 }
1055
1058
1061
1062 std::vector<Steinberg::Vst::AudioBusBuffers> busBuffers;
1063 std::vector<ChannelMapping> mappings;
1064};
1065
1066//==============================================================================
1067template <class ObjectType>
1069{
1070public:
1072 VSTComSmartPtr (ObjectType* object, bool autoAddRef = true) noexcept : source (object) { if (source != nullptr && autoAddRef) source->addRef(); }
1073 VSTComSmartPtr (const VSTComSmartPtr& other) noexcept : source (other.source) { if (source != nullptr) source->addRef(); }
1074 ~VSTComSmartPtr() { if (source != nullptr) source->release(); }
1075
1076 operator ObjectType*() const noexcept { return source; }
1077 ObjectType* get() const noexcept { return source; }
1078 ObjectType& operator*() const noexcept { return *source; }
1079 ObjectType* operator->() const noexcept { return source; }
1080
1081 VSTComSmartPtr& operator= (const VSTComSmartPtr& other) { return operator= (other.source); }
1082
1083 VSTComSmartPtr& operator= (ObjectType* const newObjectToTakePossessionOf)
1084 {
1085 VSTComSmartPtr p (newObjectToTakePossessionOf);
1086 std::swap (p.source, source);
1087 return *this;
1088 }
1089
1090 bool operator== (ObjectType* const other) noexcept { return source == other; }
1091 bool operator!= (ObjectType* const other) noexcept { return source != other; }
1092
1094 {
1095 *this = nullptr;
1096 return o != nullptr && o->queryInterface (ObjectType::iid, (void**) &source) == Steinberg::kResultOk;
1097 }
1098
1100 {
1101 jassert (factory != nullptr);
1102 *this = nullptr;
1103 return factory->createInstance (uuid, ObjectType::iid, (void**) &source) == Steinberg::kResultOk;
1104 }
1105
1106private:
1107 ObjectType* source;
1108};
1109
1110//==============================================================================
1111/* This class stores a plugin's preferred MIDI mappings.
1112
1113 The IMidiMapping is normally an extension of the IEditController which
1114 should only be accessed from the UI thread. If we're being strict about
1115 things, then we shouldn't call IMidiMapping functions from the audio thread.
1116
1117 This code is very similar to that found in the audioclient demo code in the
1118 VST3 SDK repo.
1119*/
1121{
1122public:
1124 {
1125 for (auto& channel : channels)
1126 channel.resize (Steinberg::Vst::kCountCtrlNumber);
1127 }
1128
1130 {
1131 for (size_t channelIndex = 0; channelIndex < channels.size(); ++channelIndex)
1132 storeControllers (mapping, channels[channelIndex], channelIndex);
1133 }
1134
1135 /* Returns kNoParamId if there is no mapping for this controller. */
1138 {
1139 return channels[(size_t) channel][(size_t) controller];
1140 }
1141
1142private:
1143 // Maps controller numbers to ParamIDs
1144 using Controllers = std::vector<Steinberg::Vst::ParamID>;
1145
1146 // Each channel may have a different CC mapping
1147 using Channels = std::array<Controllers, 16>;
1148
1149 static void storeControllers (Steinberg::Vst::IMidiMapping& mapping, Controllers& channel, size_t channelIndex)
1150 {
1151 for (size_t controllerIndex = 0; controllerIndex < channel.size(); ++controllerIndex)
1152 channel[controllerIndex] = getSingleMapping (mapping, channelIndex, controllerIndex);
1153 }
1154
1156 size_t channelIndex,
1157 size_t controllerIndex)
1158 {
1160 const auto returnCode = mapping.getMidiControllerAssignment (0,
1161 (int16) channelIndex,
1162 (Steinberg::Vst::CtrlNumber) controllerIndex,
1163 result);
1164
1166 }
1167
1169};
1170
1171//==============================================================================
1173{
1174public:
1175 MidiEventList() = default;
1176 virtual ~MidiEventList() = default;
1177
1180
1181 //==============================================================================
1182 void clear()
1183 {
1184 events.clearQuick();
1185 }
1186
1187 Steinberg::int32 PLUGIN_API getEventCount() override
1188 {
1189 return (Steinberg::int32) events.size();
1190 }
1191
1192 // NB: This has to cope with out-of-range indexes from some plugins.
1194 {
1195 if (isPositiveAndBelow ((int) index, events.size()))
1196 {
1197 e = events.getReference ((int) index);
1199 }
1200
1202 }
1203
1205 {
1206 events.add (e);
1208 }
1209
1210 //==============================================================================
1212 {
1213 const auto numEvents = eventList.getEventCount();
1214
1215 for (Steinberg::int32 i = 0; i < numEvents; ++i)
1216 {
1218
1219 if (eventList.getEvent (i, e) != Steinberg::kResultOk)
1220 continue;
1221
1222 if (const auto message = toMidiMessage (e))
1223 result.addEvent (*message, e.sampleOffset);
1224 }
1225 }
1226
1227 template <typename Callback>
1229 MidiBuffer& midiBuffer,
1230 StoredMidiMapping& mapping,
1231 Callback&& callback)
1232 {
1233 toEventList (result, midiBuffer, &mapping, callback);
1234 }
1235
1237 {
1238 toEventList (result, midiBuffer, nullptr, [] (auto&&...) {});
1239 }
1240
1241private:
1243 {
1244 // Hosted plugins don't expect to receive LegacyMIDICCEvents messages from the host,
1245 // so if we're converting midi from the host to an eventlist, this mode will avoid
1246 // converting to Legacy events where possible.
1247 hostToPlugin,
1248
1249 // If plugins generate MIDI internally, then where possible we should preserve
1250 // these messages as LegacyMIDICCOut events.
1251 pluginToHost
1252 };
1253
1254 template <typename Callback>
1256 StoredMidiMapping* midiMapping,
1257 Callback&& callback)
1258 {
1259 if (midiMapping == nullptr)
1260 return false;
1261
1262 const auto controlEvent = toVst3ControlEvent (msg);
1263
1264 if (! controlEvent.hasValue())
1265 return false;
1266
1267 const auto controlParamID = midiMapping->getMapping (createSafeChannel (msg.getChannel()),
1268 controlEvent->controllerNumber);
1269
1270 if (controlParamID != Steinberg::Vst::kNoParamId)
1271 callback (controlParamID, controlEvent->paramValue);
1272
1273 return true;
1274 }
1275
1276 template <typename Callback>
1278 const MidiMessageMetadata metadata,
1279 StoredMidiMapping* midiMapping,
1280 Callback&& callback)
1281 {
1282 const auto msg = metadata.getMessage();
1283
1284 if (sendMappedParameter (msg, midiMapping, std::forward<Callback> (callback)))
1285 return;
1286
1287 const auto kind = midiMapping != nullptr ? EventConversionKind::hostToPlugin
1289
1290 auto maybeEvent = createVstEvent (msg, metadata.data, kind);
1291
1292 if (! maybeEvent.hasValue())
1293 return;
1294
1295 maybeEvent->busIndex = 0;
1296 maybeEvent->sampleOffset = metadata.samplePosition;
1297 result.addEvent (*maybeEvent);
1298 }
1299
1300 /* If mapping is non-null, the conversion is assumed to be host-to-plugin, or otherwise
1301 plugin-to-host.
1302 */
1303 template <typename Callback>
1305 MidiBuffer& midiBuffer,
1306 StoredMidiMapping* midiMapping,
1307 Callback&& callback)
1308 {
1309 enum { maxNumEvents = 2048 }; // Steinberg's Host Checker states that no more than 2048 events are allowed at once
1310 int numEvents = 0;
1311
1312 for (const auto metadata : midiBuffer)
1313 {
1314 if (++numEvents > maxNumEvents)
1315 break;
1316
1317 processMidiMessage (result, metadata, midiMapping, std::forward<Callback> (callback));
1318 }
1319 }
1320
1323
1324 static Steinberg::int16 createSafeChannel (int channel) noexcept { return (Steinberg::int16) jlimit (0, 15, channel - 1); }
1325 static int createSafeChannel (Steinberg::int16 channel) noexcept { return (int) jlimit (1, 16, channel + 1); }
1326
1327 static Steinberg::int16 createSafeNote (int note) noexcept { return (Steinberg::int16) jlimit (0, 127, note); }
1328 static int createSafeNote (Steinberg::int16 note) noexcept { return jlimit (0, 127, (int) note); }
1329
1330 static float normaliseMidiValue (int value) noexcept { return jlimit (0.0f, 1.0f, (float) value / 127.0f); }
1331 static int denormaliseToMidiValue (float value) noexcept { return roundToInt (jlimit (0.0f, 127.0f, value * 127.0f)); }
1332
1334 {
1337 e.noteOn.channel = createSafeChannel (msg.getChannel());
1338 e.noteOn.pitch = createSafeNote (msg.getNoteNumber());
1339 e.noteOn.velocity = normaliseMidiValue (msg.getVelocity());
1340 e.noteOn.length = 0;
1341 e.noteOn.tuning = 0.0f;
1342 e.noteOn.noteId = -1;
1343 return e;
1344 }
1345
1347 {
1350 e.noteOff.channel = createSafeChannel (msg.getChannel());
1351 e.noteOff.pitch = createSafeNote (msg.getNoteNumber());
1352 e.noteOff.velocity = normaliseMidiValue (msg.getVelocity());
1353 e.noteOff.tuning = 0.0f;
1354 e.noteOff.noteId = -1;
1355 return e;
1356 }
1357
1358 static Steinberg::Vst::Event createSysExEvent (const MidiMessage& msg, const uint8* midiEventData) noexcept
1359 {
1362 e.data.bytes = midiEventData + 1;
1363 e.data.size = (uint32) msg.getSysExDataSize();
1365 return e;
1366 }
1367
1368 static Steinberg::Vst::Event createLegacyMIDIEvent (int channel, int controlNumber, int value, int value2 = 0)
1369 {
1372 e.midiCCOut.channel = Steinberg::int8 (createSafeChannel (channel));
1373 e.midiCCOut.controlNumber = uint8 (jlimit (0, 255, controlNumber));
1374 e.midiCCOut.value = Steinberg::int8 (createSafeNote (value));
1375 e.midiCCOut.value2 = Steinberg::int8 (createSafeNote (value2));
1376 return e;
1377 }
1378
1380 {
1383 e.polyPressure.channel = createSafeChannel (msg.getChannel());
1384 e.polyPressure.pitch = createSafeNote (msg.getNoteNumber());
1385 e.polyPressure.pressure = normaliseMidiValue (msg.getAfterTouchValue());
1386 e.polyPressure.noteId = -1;
1387 return e;
1388 }
1389
1391 {
1392 return createLegacyMIDIEvent (msg.getChannel(),
1394 msg.getChannelPressureValue());
1395 }
1396
1398 {
1399 return createLegacyMIDIEvent (msg.getChannel(),
1400 msg.getControllerNumber(),
1401 msg.getControllerValue());
1402 }
1403
1405 {
1406 return createLegacyMIDIEvent (msg.getChannel(),
1408 msg.getNoteNumber(),
1409 msg.getAfterTouchValue());
1410 }
1411
1413 {
1414 return createLegacyMIDIEvent (msg.getChannel(),
1416 msg.getRawData()[1],
1417 msg.getRawData()[2]);
1418 }
1419
1421 {
1422 return createLegacyMIDIEvent (msg.getChannel(),
1424 msg.getProgramChangeNumber());
1425 }
1426
1428 {
1429 return createLegacyMIDIEvent (msg.getChannel(),
1431 msg.getQuarterFrameValue());
1432 }
1433
1435 const uint8* midiEventData,
1436 EventConversionKind kind) noexcept
1437 {
1438 if (msg.isNoteOn())
1439 return createNoteOnEvent (msg);
1440
1441 if (msg.isNoteOff())
1442 return createNoteOffEvent (msg);
1443
1444 if (msg.isSysEx())
1445 return createSysExEvent (msg, midiEventData);
1446
1447 if (msg.isChannelPressure())
1449
1450 if (msg.isPitchWheel())
1451 return createPitchWheelEvent (msg);
1452
1453 if (msg.isProgramChange())
1455
1456 if (msg.isController())
1457 return createControllerEvent (msg);
1458
1459 if (msg.isQuarterFrame())
1461
1462 if (msg.isAftertouch())
1463 {
1464 switch (kind)
1465 {
1468
1471 }
1472
1474 return {};
1475 }
1476
1477 return {};
1478 }
1479
1481 {
1482 if (e.controlNumber <= 127)
1484 createSafeNote (int16 (e.controlNumber)),
1485 createSafeNote (int16 (e.value)));
1486
1487 switch (e.controlNumber)
1488 {
1491 createSafeNote (int16 (e.value)));
1492
1495 (e.value & 0x7f) | ((e.value2 & 0x7f) << 7));
1496
1499 createSafeNote (int16 (e.value)));
1500
1503 createSafeNote (int16 (e.value)));
1504
1507 createSafeNote (int16 (e.value)),
1508 createSafeNote (int16 (e.value2)));
1509
1510 default:
1511 // If this is hit, we're trying to convert a LegacyMIDICCOutEvent with an unknown controlNumber.
1513 return {};
1514 }
1515 }
1516
1518 {
1519 switch (e.type)
1520 {
1522 return MidiMessage::noteOn (createSafeChannel (e.noteOn.channel),
1523 createSafeNote (e.noteOn.pitch),
1524 (Steinberg::uint8) denormaliseToMidiValue (e.noteOn.velocity));
1525
1527 return MidiMessage::noteOff (createSafeChannel (e.noteOff.channel),
1528 createSafeNote (e.noteOff.pitch),
1529 (Steinberg::uint8) denormaliseToMidiValue (e.noteOff.velocity));
1530
1532 return MidiMessage::aftertouchChange (createSafeChannel (e.polyPressure.channel),
1533 createSafeNote (e.polyPressure.pitch),
1534 (Steinberg::uint8) denormaliseToMidiValue (e.polyPressure.pressure));
1535
1537 return MidiMessage::createSysExMessage (e.data.bytes, (int) e.data.size);
1538
1540 return toMidiMessage (e.midiCCOut);
1541
1546 return {};
1547
1548 default:
1549 break;
1550 }
1551
1552 // If this is hit, we've been sent an event type that doesn't exist in the VST3 spec.
1554 return {};
1555 }
1556
1557 //==============================================================================
1563
1565 {
1566 if (msg.isController())
1567 return Vst3MidiControlEvent { (Steinberg::Vst::CtrlNumber) msg.getControllerNumber(), msg.getControllerValue() / 127.0 };
1568
1569 if (msg.isPitchWheel())
1570 return Vst3MidiControlEvent { Steinberg::Vst::kPitchBend, msg.getPitchWheelValue() / 16383.0};
1571
1572 if (msg.isChannelPressure())
1573 return Vst3MidiControlEvent { Steinberg::Vst::kAfterTouch, msg.getChannelPressureValue() / 127.0};
1574
1575 return {};
1576 }
1577
1579};
1580
1581//==============================================================================
1582/* Provides very quick polling of all parameter states.
1583
1584 We must iterate all parameters on each processBlock call to check whether any
1585 parameter value has changed. This class attempts to make this polling process
1586 as quick as possible.
1587
1588 The indices here are of type Steinberg::int32, as they are expected to correspond
1589 to parameter information obtained from the IEditController. These indices may not
1590 match the indices of parameters returned from AudioProcessor::getParameters(), so
1591 be careful!
1592*/
1594{
1595public:
1597
1598 explicit CachedParamValues (std::vector<Steinberg::Vst::ParamID> paramIdsIn)
1599 : paramIds (std::move (paramIdsIn)), floatCache (paramIds.size()) {}
1600
1601 size_t size() const noexcept { return floatCache.size(); }
1602
1603 Steinberg::Vst::ParamID getParamID (Steinberg::int32 index) const noexcept { return paramIds[(size_t) index]; }
1604
1605 void set (Steinberg::int32 index, float value) { floatCache.setValueAndBits ((size_t) index, value, 1); }
1606 void setWithoutNotifying (Steinberg::int32 index, float value) { floatCache.setValue ((size_t) index, value); }
1607
1608 float get (Steinberg::int32 index) const noexcept { return floatCache.get ((size_t) index); }
1609
1610 template <typename Callback>
1611 void ifSet (Callback&& callback)
1612 {
1613 floatCache.ifSet ([&] (size_t index, float value, uint32_t)
1614 {
1615 callback ((Steinberg::int32) index, value);
1616 });
1617 }
1618
1619private:
1620 std::vector<Steinberg::Vst::ParamID> paramIds;
1622};
1623
1624//==============================================================================
1625/* Ensures that a 'restart' call only ever happens on the main thread. */
1627{
1628public:
1630 {
1631 virtual ~Listener() = default;
1633 };
1634
1635 explicit ComponentRestarter (Listener& listenerIn)
1636 : listener (listenerIn) {}
1637
1639 {
1641 }
1642
1643 void restart (int32 newFlags)
1644 {
1645 if (newFlags == 0)
1646 return;
1647
1648 flags.fetch_or (newFlags);
1649
1650 if (MessageManager::getInstance()->isThisTheMessageThread())
1652 else
1654 }
1655
1656private:
1657 void handleAsyncUpdate() override
1658 {
1659 listener.restartComponentOnMessageThread (flags.exchange (0));
1660 }
1661
1663 std::atomic<int32> flags { 0 };
1664};
1665
1667
1668} // namespace juce
1669
1670#endif
Type jmax(const Type a, const Type b)
Definition MathsFunctions.h:48
Controller controller
Definition main.C:5
#define noexcept
Definition DistrhoDefines.h:72
uint8_t a
Definition Spc_Cpu.h:141
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
static void message(int level, const char *fmt,...)
Definition adplugdb.cpp:120
uint8_t uint8
Definition basics.h:86
static MidiMessage createSysExMessage(const void *sysexData, int dataSize)
Definition MidiMessage.cpp:606
static MidiMessage noteOn(int channel, int noteNumber, float velocity) noexcept
Definition MidiMessage.cpp:534
static MidiMessage aftertouchChange(int channel, int noteNumber, int aftertouchAmount) noexcept
Definition MidiMessage.cpp:412
static MidiMessage noteOff(int channel, int noteNumber, float velocity) noexcept
Definition MidiMessage.cpp:548
static MidiMessage controllerEvent(int channel, int controllerType, int value) noexcept
Definition MidiMessage.cpp:516
static MidiMessage channelPressureChange(int channel, int pressure) noexcept
Definition MidiMessage.cpp:436
static MidiMessage pitchWheel(int channel, int position) noexcept
Definition MidiMessage.cpp:484
static MidiMessage programChange(int channel, int programNumber) noexcept
Definition MidiMessage.cpp:465
static MidiMessage quarterFrame(int sequenceNumber, int value) noexcept
Definition MidiMessage.cpp:811
Definition funknown.h:361
virtual tresult PLUGIN_API queryInterface(const TUID _iid, void **obj)=0
Definition ipluginbase.h:159
virtual tresult PLUGIN_API createInstance(FIDString cid, FIDString _iid, void **obj)=0
Definition ustring.h:29
UString & fromAscii(const char *src, int32 srcSize=-1)
Definition ustring.cpp:132
UString & assign(const char16 *src, int32 srcSize=-1)
Definition ustring.cpp:110
Definition ivstaudioprocessor.h:259
virtual tresult PLUGIN_API getBusArrangement(BusDirection dir, int32 index, SpeakerArrangement &arr)=0
Definition ivstevents.h:197
virtual int32 PLUGIN_API getEventCount()=0
virtual tresult PLUGIN_API getEvent(int32 index, Event &e)=0
Definition ivsteditcontroller.h:551
virtual tresult PLUGIN_API getMidiControllerAssignment(int32 busIndex, int16 channel, CtrlNumber midiControllerNumber, ParamID &id)=0
Definition juce_Array.h:56
void triggerAsyncUpdate()
Definition juce_AsyncUpdater.cpp:62
void cancelPendingUpdate() noexcept
Definition juce_AsyncUpdater.cpp:74
AsyncUpdater()
Definition juce_AsyncUpdater.cpp:44
Definition juce_AudioSampleBuffer.h:34
Definition juce_AudioChannelSet.h:47
static AudioChannelSet JUCE_CALLTYPE disabled()
Definition juce_AudioChannelSet.cpp:450
static AudioChannelSet JUCE_CALLTYPE mono()
Definition juce_AudioChannelSet.cpp:451
ChannelType
Definition juce_AudioChannelSet.h:317
@ wideRight
Definition juce_AudioChannelSet.h:346
@ topFrontRight
Definition juce_AudioChannelSet.h:338
@ ambisonicACN2
Definition juce_AudioChannelSet.h:359
@ topFrontLeft
Definition juce_AudioChannelSet.h:336
@ ambisonicACN25
Definition juce_AudioChannelSet.h:390
@ ambisonicACN28
Definition juce_AudioChannelSet.h:393
@ right
Definition juce_AudioChannelSet.h:322
@ ambisonicACN13
Definition juce_AudioChannelSet.h:374
@ ambisonicACN8
Definition juce_AudioChannelSet.h:367
@ ambisonicACN4
Definition juce_AudioChannelSet.h:363
@ leftSurround
Definition juce_AudioChannelSet.h:327
@ topRearLeft
Definition juce_AudioChannelSet.h:339
@ ambisonicACN15
Definition juce_AudioChannelSet.h:376
@ centreSurround
Definition juce_AudioChannelSet.h:331
@ topSideLeft
Definition juce_AudioChannelSet.h:350
@ ambisonicACN30
Definition juce_AudioChannelSet.h:395
@ surround
Definition juce_AudioChannelSet.h:332
@ unknown
Definition juce_AudioChannelSet.h:318
@ proximityRight
Definition juce_AudioChannelSet.h:414
@ ambisonicACN19
Definition juce_AudioChannelSet.h:382
@ ambisonicACN18
Definition juce_AudioChannelSet.h:381
@ bottomRearCentre
Definition juce_AudioChannelSet.h:419
@ ambisonicACN27
Definition juce_AudioChannelSet.h:392
@ centre
Definition juce_AudioChannelSet.h:323
@ ambisonicACN21
Definition juce_AudioChannelSet.h:384
@ bottomRearRight
Definition juce_AudioChannelSet.h:420
@ ambisonicACN26
Definition juce_AudioChannelSet.h:391
@ ambisonicACN22
Definition juce_AudioChannelSet.h:385
@ ambisonicACN12
Definition juce_AudioChannelSet.h:373
@ bottomRearLeft
Definition juce_AudioChannelSet.h:418
@ ambisonicACN24
Definition juce_AudioChannelSet.h:387
@ topSideRight
Definition juce_AudioChannelSet.h:351
@ ambisonicACN1
Definition juce_AudioChannelSet.h:358
@ ambisonicACN32
Definition juce_AudioChannelSet.h:397
@ rightSurroundRear
Definition juce_AudioChannelSet.h:344
@ rightSurroundSide
Definition juce_AudioChannelSet.h:334
@ ambisonicACN29
Definition juce_AudioChannelSet.h:394
@ ambisonicACN3
Definition juce_AudioChannelSet.h:360
@ ambisonicACN31
Definition juce_AudioChannelSet.h:396
@ bottomFrontRight
Definition juce_AudioChannelSet.h:411
@ ambisonicACN6
Definition juce_AudioChannelSet.h:365
@ wideLeft
Definition juce_AudioChannelSet.h:345
@ ambisonicACN17
Definition juce_AudioChannelSet.h:380
@ proximityLeft
Definition juce_AudioChannelSet.h:413
@ ambisonicACN35
Definition juce_AudioChannelSet.h:400
@ rightSurround
Definition juce_AudioChannelSet.h:328
@ ambisonicACN20
Definition juce_AudioChannelSet.h:383
@ ambisonicACN16
Definition juce_AudioChannelSet.h:379
@ ambisonicACN0
Definition juce_AudioChannelSet.h:357
@ bottomFrontCentre
Definition juce_AudioChannelSet.h:410
@ ambisonicACN10
Definition juce_AudioChannelSet.h:371
@ topRearCentre
Definition juce_AudioChannelSet.h:340
@ ambisonicACN14
Definition juce_AudioChannelSet.h:375
@ topMiddle
Definition juce_AudioChannelSet.h:335
@ topFrontCentre
Definition juce_AudioChannelSet.h:337
@ ambisonicACN34
Definition juce_AudioChannelSet.h:399
@ topRearRight
Definition juce_AudioChannelSet.h:341
@ LFE2
Definition juce_AudioChannelSet.h:342
@ rightCentre
Definition juce_AudioChannelSet.h:330
@ leftCentre
Definition juce_AudioChannelSet.h:329
@ bottomSideRight
Definition juce_AudioChannelSet.h:417
@ ambisonicACN5
Definition juce_AudioChannelSet.h:364
@ ambisonicACN23
Definition juce_AudioChannelSet.h:386
@ ambisonicACN11
Definition juce_AudioChannelSet.h:372
@ leftSurroundSide
Definition juce_AudioChannelSet.h:333
@ bottomSideLeft
Definition juce_AudioChannelSet.h:416
@ ambisonicACN7
Definition juce_AudioChannelSet.h:366
@ ambisonicACN33
Definition juce_AudioChannelSet.h:398
@ discreteChannel0
Definition juce_AudioChannelSet.h:423
@ bottomFrontLeft
Definition juce_AudioChannelSet.h:409
@ leftSurroundRear
Definition juce_AudioChannelSet.h:343
@ left
Definition juce_AudioChannelSet.h:321
@ ambisonicACN9
Definition juce_AudioChannelSet.h:370
@ LFE
Definition juce_AudioChannelSet.h:326
static AudioChannelSet JUCE_CALLTYPE channelSetWithChannels(const Array< ChannelType > &)
Definition juce_AudioChannelSet.cpp:605
int getChannelIndexForType(ChannelType type) const noexcept
Definition juce_AudioChannelSet.cpp:411
Definition juce_AudioProcessor.h:361
Definition juce_AudioProcessor.h:46
Bus * getBus(bool isInput, int busIndex) noexcept
Definition juce_AudioProcessor.h:509
int getBusCount(bool isInput) const noexcept
Definition juce_AudioProcessor.h:504
Definition juce_BigInteger.h:39
int findNextSetBit(int startIndex) const noexcept
Definition juce_BigInteger.cpp:387
void ifSet(Callback &&callback)
Definition juce_VST3Common.h:1611
CachedParamValues(std::vector< Steinberg::Vst::ParamID > paramIdsIn)
Definition juce_VST3Common.h:1598
float get(Steinberg::int32 index) const noexcept
Definition juce_VST3Common.h:1608
void setWithoutNotifying(Steinberg::int32 index, float value)
Definition juce_VST3Common.h:1606
FlaggedFloatCache< 1 > floatCache
Definition juce_VST3Common.h:1621
size_t size() const noexcept
Definition juce_VST3Common.h:1601
std::vector< Steinberg::Vst::ParamID > paramIds
Definition juce_VST3Common.h:1620
Steinberg::Vst::ParamID getParamID(Steinberg::int32 index) const noexcept
Definition juce_VST3Common.h:1603
void set(Steinberg::int32 index, float value)
Definition juce_VST3Common.h:1605
Definition juce_VST3Common.h:652
static void setUpOutputChannels(ScratchBuffer< FloatType > &scratchBuffer, const std::vector< DynamicChannelMapping > &map, std::vector< FloatType * > &channels)
Definition juce_VST3Common.h:722
std::vector< FloatType * > channels
Definition juce_VST3Common.h:758
AudioBuffer< FloatType > getBlankBuffer(int usedChannels, int usedSamples)
Definition juce_VST3Common.h:743
AudioBuffer< FloatType > getMappedBuffer(Steinberg::Vst::ProcessData &data, const std::vector< DynamicChannelMapping > &inputMap, const std::vector< DynamicChannelMapping > &outputMap)
Definition juce_VST3Common.h:660
static void setUpInputChannels(Steinberg::Vst::ProcessData &data, size_t vstInputs, ScratchBuffer< FloatType > &scratchBuffer, const std::vector< DynamicChannelMapping > &map, std::vector< FloatType * > &channels)
Definition juce_VST3Common.h:685
void prepare(int numChannels, int blockSize)
Definition juce_VST3Common.h:654
ScratchBuffer< FloatType > scratchBuffer
Definition juce_VST3Common.h:759
Definition juce_VST3Common.h:779
auto & getData(detail::Tag< float >)
Definition juce_VST3Common.h:856
std::vector< DynamicChannelMapping > outputMap
Definition juce_VST3Common.h:891
AudioChannelSet getRequestedLayoutForInputBus(size_t bus) const
Definition juce_VST3Common.h:859
void updateActiveClientBuses(const AudioProcessor::BusesLayout &clientBuses)
Definition juce_VST3Common.h:831
AudioChannelSet getRequestedLayoutForOutputBus(size_t bus) const
Definition juce_VST3Common.h:864
auto & getData(detail::Tag< double >)
Definition juce_VST3Common.h:857
void updateFromProcessor(const AudioProcessor &processor)
Definition juce_VST3Common.h:781
void setOutputBusHostActive(size_t bus, bool state)
Definition juce_VST3Common.h:854
void prepare(int blockSize)
Definition juce_VST3Common.h:814
std::vector< DynamicChannelMapping > inputMap
Definition juce_VST3Common.h:890
const std::vector< DynamicChannelMapping > & getInputMap() const
Definition juce_VST3Common.h:869
ClientBufferMapperData< float > floatData
Definition juce_VST3Common.h:887
void setInputBusHostActive(size_t bus, bool state)
Definition juce_VST3Common.h:853
ClientBufferMapperData< double > doubleData
Definition juce_VST3Common.h:888
const std::vector< DynamicChannelMapping > & getOutputMap() const
Definition juce_VST3Common.h:870
static AudioChannelSet getRequestedLayoutForBus(const std::vector< DynamicChannelMapping > &map, size_t bus)
Definition juce_VST3Common.h:879
static void setHostActive(std::vector< DynamicChannelMapping > &map, size_t bus, bool state)
Definition juce_VST3Common.h:873
ClientRemappedBuffer(ClientBufferMapper &mapperIn, Steinberg::Vst::ProcessData &hostData)
Definition juce_VST3Common.h:912
ClientRemappedBuffer(ClientBufferMapperData< FloatType > &mapperData, const std::vector< DynamicChannelMapping > *inputMapIn, const std::vector< DynamicChannelMapping > *outputMapIn, Steinberg::Vst::ProcessData &hostData)
Definition juce_VST3Common.h:903
const std::vector< DynamicChannelMapping > * outputMap
Definition juce_VST3Common.h:983
void clearHostOutputBuses(size_t vstOutputs) const
Definition juce_VST3Common.h:967
Steinberg::Vst::ProcessData & data
Definition juce_VST3Common.h:984
~ClientRemappedBuffer()
Definition juce_VST3Common.h:919
AudioBuffer< FloatType > buffer
Definition juce_VST3Common.h:930
void copyToHostOutputBuses(size_t vstOutputs) const
Definition juce_VST3Common.h:933
void restart(int32 newFlags)
Definition juce_VST3Common.h:1643
void handleAsyncUpdate() override
Definition juce_VST3Common.h:1657
Listener & listener
Definition juce_VST3Common.h:1662
std::atomic< int32 > flags
Definition juce_VST3Common.h:1663
~ComponentRestarter() noexcept override
Definition juce_VST3Common.h:1638
ComponentRestarter(Listener &listenerIn)
Definition juce_VST3Common.h:1635
Definition juce_VST3Common.h:540
void setClientActive(bool active)
Definition juce_VST3Common.h:561
AudioChannelSet getAudioChannelSet() const
Definition juce_VST3Common.h:551
bool isHostActive() const
Definition juce_VST3Common.h:556
DynamicChannelMapping(const AudioChannelSet &channelSet, bool active)
Definition juce_VST3Common.h:542
DynamicChannelMapping(const AudioChannelSet &channelSet)
Definition juce_VST3Common.h:545
bool hostActive
Definition juce_VST3Common.h:566
int getJuceChannelForVst3Channel(int vst3Channel) const
Definition juce_VST3Common.h:552
void setHostActive(bool active)
Definition juce_VST3Common.h:560
DynamicChannelMapping(const AudioProcessor::Bus &bus)
Definition juce_VST3Common.h:548
size_t size() const
Definition juce_VST3Common.h:553
AudioChannelSet set
Definition juce_VST3Common.h:564
ChannelMapping map
Definition juce_VST3Common.h:565
bool isClientActive() const
Definition juce_VST3Common.h:558
Definition juce_FlagCache.h:130
Definition juce_VST3Common.h:998
auto & get(detail::Tag< float >)
Definition juce_VST3Common.h:1056
void prepare(std::vector< ChannelMapping > arrangements)
Definition juce_VST3Common.h:1001
auto & get(detail::Tag< double >)
Definition juce_VST3Common.h:1057
std::vector< Steinberg::Vst::AudioBusBuffers > busBuffers
Definition juce_VST3Common.h:1062
BusMap< double > doubleBusMap
Definition juce_VST3Common.h:1060
std::vector< Bus< FloatType > > BusMap
Definition juce_VST3Common.h:1031
static void assignRawPointer(Steinberg::Vst::AudioBusBuffers &vstBuffers, double **raw)
Definition juce_VST3Common.h:1034
std::vector< ChannelMapping > mappings
Definition juce_VST3Common.h:1063
static void assignRawPointer(Steinberg::Vst::AudioBusBuffers &vstBuffers, float **raw)
Definition juce_VST3Common.h:1033
std::vector< FloatType * > Bus
Definition juce_VST3Common.h:1028
BusMap< float > floatBusMap
Definition juce_VST3Common.h:1059
void associateBufferTo(Steinberg::Vst::AudioBusBuffers &vstBuffers, Bus< FloatType > &bus, AudioBuffer< FloatType > &buffer, const ChannelMapping &busMap, int channelStartOffset) const
Definition juce_VST3Common.h:1037
Steinberg::Vst::AudioBusBuffers * getVst3LayoutForJuceBuffer(AudioBuffer< FloatType > &source)
Definition juce_VST3Common.h:1012
Definition juce_VST3Common.h:88
bool isOk() const noexcept
Definition juce_VST3Common.h:97
void(* addRefFn)(void *)
Definition juce_VST3Common.h:114
QueryInterfaceResult result
Definition juce_VST3Common.h:113
static void doAddRef(void *obj)
Definition juce_VST3Common.h:111
InterfaceResultWithDeferredAddRef(Steinberg::tresult resultIn, Ptr *ptrIn)
Definition juce_VST3Common.h:93
Steinberg::tresult extract(void **obj) const
Definition juce_VST3Common.h:99
static MessageManager * getInstance()
Definition juce_MessageManager.cpp:47
Definition juce_MidiBuffer.h:145
Definition juce_VST3Common.h:1173
static Steinberg::int16 createSafeChannel(int channel) noexcept
Definition juce_VST3Common.h:1324
static Steinberg::int16 createSafeNote(int note) noexcept
Definition juce_VST3Common.h:1327
static Steinberg::Vst::Event createControllerEvent(const MidiMessage &msg) noexcept
Definition juce_VST3Common.h:1397
static void hostToPluginEventList(Steinberg::Vst::IEventList &result, MidiBuffer &midiBuffer, StoredMidiMapping &mapping, Callback &&callback)
Definition juce_VST3Common.h:1228
JUCE_DECLARE_VST3_COM_REF_METHODS JUCE_DECLARE_VST3_COM_QUERY_METHODS void clear()
Definition juce_VST3Common.h:1182
static Optional< MidiMessage > toMidiMessage(const Steinberg::Vst::LegacyMIDICCOutEvent &e)
Definition juce_VST3Common.h:1480
Atomic< int > refCount
Definition juce_VST3Common.h:1322
static void toEventList(Steinberg::Vst::IEventList &result, MidiBuffer &midiBuffer, StoredMidiMapping *midiMapping, Callback &&callback)
Definition juce_VST3Common.h:1304
virtual ~MidiEventList()=default
static void toMidiBuffer(MidiBuffer &result, Steinberg::Vst::IEventList &eventList)
Definition juce_VST3Common.h:1211
static bool sendMappedParameter(const MidiMessage &msg, StoredMidiMapping *midiMapping, Callback &&callback)
Definition juce_VST3Common.h:1255
Steinberg::tresult PLUGIN_API addEvent(Steinberg::Vst::Event &e) override
Definition juce_VST3Common.h:1204
static Steinberg::Vst::Event createPolyPressureEvent(const MidiMessage &msg)
Definition juce_VST3Common.h:1379
static int createSafeNote(Steinberg::int16 note) noexcept
Definition juce_VST3Common.h:1328
static Steinberg::Vst::Event createChannelPressureEvent(const MidiMessage &msg) noexcept
Definition juce_VST3Common.h:1390
static int denormaliseToMidiValue(float value) noexcept
Definition juce_VST3Common.h:1331
static Steinberg::Vst::Event createNoteOffEvent(const MidiMessage &msg) noexcept
Definition juce_VST3Common.h:1346
static Steinberg::Vst::Event createPitchWheelEvent(const MidiMessage &msg) noexcept
Definition juce_VST3Common.h:1412
Array< Steinberg::Vst::Event, CriticalSection > events
Definition juce_VST3Common.h:1321
static Steinberg::Vst::Event createProgramChangeEvent(const MidiMessage &msg) noexcept
Definition juce_VST3Common.h:1420
static Steinberg::Vst::Event createLegacyMIDIEvent(int channel, int controlNumber, int value, int value2=0)
Definition juce_VST3Common.h:1368
static Optional< Vst3MidiControlEvent > toVst3ControlEvent(const MidiMessage &msg)
Definition juce_VST3Common.h:1564
static Steinberg::Vst::Event createCtrlQuarterFrameEvent(const MidiMessage &msg) noexcept
Definition juce_VST3Common.h:1427
static Steinberg::Vst::Event createNoteOnEvent(const MidiMessage &msg) noexcept
Definition juce_VST3Common.h:1333
MidiEventList()=default
static Optional< Steinberg::Vst::Event > createVstEvent(const MidiMessage &msg, const uint8 *midiEventData, EventConversionKind kind) noexcept
Definition juce_VST3Common.h:1434
static void pluginToHostEventList(Steinberg::Vst::IEventList &result, MidiBuffer &midiBuffer)
Definition juce_VST3Common.h:1236
EventConversionKind
Definition juce_VST3Common.h:1243
@ pluginToHost
Definition juce_VST3Common.h:1251
@ hostToPlugin
Definition juce_VST3Common.h:1247
static int createSafeChannel(Steinberg::int16 channel) noexcept
Definition juce_VST3Common.h:1325
static Steinberg::Vst::Event createCtrlPolyPressureEvent(const MidiMessage &msg) noexcept
Definition juce_VST3Common.h:1404
static Steinberg::Vst::Event createSysExEvent(const MidiMessage &msg, const uint8 *midiEventData) noexcept
Definition juce_VST3Common.h:1358
Steinberg::tresult PLUGIN_API getEvent(Steinberg::int32 index, Steinberg::Vst::Event &e) override
Definition juce_VST3Common.h:1193
static void processMidiMessage(Steinberg::Vst::IEventList &result, const MidiMessageMetadata metadata, StoredMidiMapping *midiMapping, Callback &&callback)
Definition juce_VST3Common.h:1277
static Optional< MidiMessage > toMidiMessage(const Steinberg::Vst::Event &e)
Definition juce_VST3Common.h:1517
static float normaliseMidiValue(int value) noexcept
Definition juce_VST3Common.h:1330
Steinberg::int32 PLUGIN_API getEventCount() override
Definition juce_VST3Common.h:1187
Definition juce_MidiMessage.h:35
Definition juce_Optional.h:74
Definition juce_VST3Common.h:58
Steinberg::tresult extract(void **obj) const
Definition juce_VST3Common.h:67
bool isOk() const noexcept
Definition juce_VST3Common.h:65
QueryInterfaceResult(Steinberg::tresult resultIn, void *ptrIn)
Definition juce_VST3Common.h:62
Steinberg::tresult result
Definition juce_VST3Common.h:74
void * ptr
Definition juce_VST3Common.h:75
Definition juce_VST3Common.h:589
void clear()
Definition juce_VST3Common.h:596
void setSize(int numChannels, int blockSize)
Definition juce_VST3Common.h:591
AudioBuffer< FloatType > buffer
Definition juce_VST3Common.h:603
auto * getNextChannelBuffer()
Definition juce_VST3Common.h:598
int channelCounter
Definition juce_VST3Common.h:604
auto getArrayOfWritePointers()
Definition juce_VST3Common.h:600
Definition juce_VST3Common.h:1121
StoredMidiMapping()
Definition juce_VST3Common.h:1123
static void storeControllers(Steinberg::Vst::IMidiMapping &mapping, Controllers &channel, size_t channelIndex)
Definition juce_VST3Common.h:1149
static Steinberg::Vst::ParamID getSingleMapping(Steinberg::Vst::IMidiMapping &mapping, size_t channelIndex, size_t controllerIndex)
Definition juce_VST3Common.h:1155
Steinberg::Vst::ParamID getMapping(Steinberg::int16 channel, Steinberg::Vst::CtrlNumber controller) const noexcept
Definition juce_VST3Common.h:1136
void storeMappings(Steinberg::Vst::IMidiMapping &mapping)
Definition juce_VST3Common.h:1129
std::array< Controllers, 16 > Channels
Definition juce_VST3Common.h:1147
Channels channels
Definition juce_VST3Common.h:1168
std::vector< Steinberg::Vst::ParamID > Controllers
Definition juce_VST3Common.h:1144
ObjectType * source
Definition juce_VST3Common.h:1107
VSTComSmartPtr(ObjectType *object, bool autoAddRef=true) noexcept
Definition juce_VST3Common.h:1072
ObjectType * get() const noexcept
Definition juce_VST3Common.h:1077
~VSTComSmartPtr()
Definition juce_VST3Common.h:1074
VSTComSmartPtr(const VSTComSmartPtr &other) noexcept
Definition juce_VST3Common.h:1073
VSTComSmartPtr() noexcept
Definition juce_VST3Common.h:1071
ObjectType & operator*() const noexcept
Definition juce_VST3Common.h:1078
bool loadFrom(Steinberg::FUnknown *o)
Definition juce_VST3Common.h:1093
bool loadFrom(Steinberg::IPluginFactory *factory, const Steinberg::TUID &uuid)
Definition juce_VST3Common.h:1099
ObjectType * operator->() const noexcept
Definition juce_VST3Common.h:1079
* e
Definition inflate.c:1404
register unsigned j
Definition inflate.c:1576
register unsigned i
Definition inflate.c:1575
unsigned x[BMAX+1]
Definition inflate.c:1586
static PuglViewHint int value
Definition pugl.h:1708
const Speaker kSpeakerPr
Proximity Right (Pr).
Definition vstspeaker.h:90
const Speaker kSpeakerCs
Center of Surround (Cs) - Back Center - Surround (S).
Definition vstspeaker.h:50
const Speaker kSpeakerLfe
Subbass (Lfe).
Definition vstspeaker.h:44
const Speaker kSpeakerTsl
Top Side Left (Tsl).
Definition vstspeaker.h:80
const Speaker kSpeakerACN0
Ambisonic ACN 0.
Definition vstspeaker.h:63
const Speaker kSpeakerR
Right (R).
Definition vstspeaker.h:42
const Speaker kSpeakerBfr
Bottom Front Right (Bfr).
Definition vstspeaker.h:87
const Speaker kSpeakerRcs
Right of Center Surround (Rcs) - Back Right Center.
Definition vstspeaker.h:83
const Speaker kSpeakerACN2
Ambisonic ACN 2.
Definition vstspeaker.h:65
const Speaker kSpeakerACN1
Ambisonic ACN 1.
Definition vstspeaker.h:64
const Speaker kSpeakerTrc
Top Rear/Back Center (Trc).
Definition vstspeaker.h:58
const Speaker kSpeakerACN14
Ambisonic ACN 14.
Definition vstspeaker.h:77
const Speaker kSpeakerRc
Right of Center (Rc) - Front Right Center.
Definition vstspeaker.h:48
const Speaker kSpeakerBrr
Bottom Rear Right (Brr).
Definition vstspeaker.h:96
const Speaker kSpeakerM
Mono (M).
Definition vstspeaker.h:61
const Speaker kSpeakerL
Left (L).
Definition vstspeaker.h:41
const Speaker kSpeakerACN8
Ambisonic ACN 8.
Definition vstspeaker.h:71
const Speaker kSpeakerSl
Side Left (Sl).
Definition vstspeaker.h:51
const Speaker kSpeakerLs
Left Surround (Ls).
Definition vstspeaker.h:45
const Speaker kSpeakerBrc
Bottom Rear Center (Brc).
Definition vstspeaker.h:95
const Speaker kSpeakerACN11
Ambisonic ACN 11.
Definition vstspeaker.h:74
const SpeakerArrangement kEmpty
empty arrangement
Definition vstspeaker.h:108
const Speaker kSpeakerACN13
Ambisonic ACN 13.
Definition vstspeaker.h:76
const Speaker kSpeakerTsr
Top Side Right (Tsr).
Definition vstspeaker.h:81
const Speaker kSpeakerACN4
Ambisonic ACN 4.
Definition vstspeaker.h:67
const Speaker kSpeakerSr
Side Right (Sr).
Definition vstspeaker.h:52
const Speaker kSpeakerLcs
Left of Center Surround (Lcs) - Back Left Center.
Definition vstspeaker.h:82
const Speaker kSpeakerBsl
Bottom Side Left (Bsl).
Definition vstspeaker.h:92
const Speaker kSpeakerACN5
Ambisonic ACN 5.
Definition vstspeaker.h:68
const Speaker kSpeakerTfr
Top Front Right (Tfr).
Definition vstspeaker.h:56
const Speaker kSpeakerTrl
Top Rear/Back Left (Trl).
Definition vstspeaker.h:57
const Speaker kSpeakerACN6
Ambisonic ACN 6.
Definition vstspeaker.h:69
const Speaker kSpeakerLfe2
Subbass 2 (Lfe2).
Definition vstspeaker.h:60
int32 getChannelCount(SpeakerArrangement arr)
Definition vstspeaker.h:480
const Speaker kSpeakerRs
Right Surround (Rs).
Definition vstspeaker.h:46
const Speaker kSpeakerC
Center (C).
Definition vstspeaker.h:43
const Speaker kSpeakerBrl
Bottom Rear Left (Brl).
Definition vstspeaker.h:94
const Speaker kSpeakerBfc
Bottom Front Center (Bfc).
Definition vstspeaker.h:86
const Speaker kSpeakerACN3
Ambisonic ACN 3.
Definition vstspeaker.h:66
const Speaker kSpeakerBsr
Bottom Side Right (Bsr).
Definition vstspeaker.h:93
const Speaker kSpeakerACN12
Ambisonic ACN 12.
Definition vstspeaker.h:75
const Speaker kSpeakerACN15
Ambisonic ACN 15.
Definition vstspeaker.h:78
const Speaker kSpeakerACN7
Ambisonic ACN 7.
Definition vstspeaker.h:70
const Speaker kSpeakerACN9
Ambisonic ACN 9.
Definition vstspeaker.h:72
const Speaker kSpeakerLc
Left of Center (Lc) - Front Left Center.
Definition vstspeaker.h:47
const Speaker kSpeakerTfc
Top Front Center (Tfc).
Definition vstspeaker.h:55
const Speaker kSpeakerTfl
Top Front Left (Tfl).
Definition vstspeaker.h:54
const Speaker kSpeakerTc
Top Center Over-head, Top Middle (Tc).
Definition vstspeaker.h:53
const Speaker kSpeakerBfl
Bottom Front Left (Bfl).
Definition vstspeaker.h:85
const Speaker kSpeakerTrr
Top Rear/Back Right (Trr).
Definition vstspeaker.h:59
const Speaker kSpeakerPl
Proximity Left (Pl).
Definition vstspeaker.h:89
const Speaker kSpeakerACN10
Ambisonic ACN 10.
Definition vstspeaker.h:73
JSAMPIMAGE data
Definition jpeglib.h:945
#define JUCE_END_NO_SANITIZE
Definition juce_CompilerWarnings.h:218
#define JUCE_BEGIN_NO_SANITIZE(warnings)
Definition juce_CompilerWarnings.h:217
#define jassert(expression)
#define JUCE_DECLARE_NON_MOVEABLE(className)
#define JUCE_DECLARE_NON_COPYABLE(className)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
#define jassertfalse
#define JUCE_DECLARE_VST3_COM_REF_METHODS
Definition juce_VST3Common.h:36
#define JUCE_DECLARE_VST3_COM_QUERY_METHODS
Definition juce_VST3Common.h:40
unsigned int uint32_t
Definition mid.cpp:100
const char * msg
Definition missing_descriptor.c:20
Definition vstspeaker.h:103
const SpeakerArrangement k71_6
Definition vstspeaker.h:246
const SpeakerArrangement k51
Definition vstspeaker.h:140
const SpeakerArrangement k70Cine
Definition vstspeaker.h:150
const SpeakerArrangement k71Cine
Definition vstspeaker.h:152
const SpeakerArrangement kMono
M.
Definition vstspeaker.h:109
const SpeakerArrangement k70Music
Definition vstspeaker.h:155
const SpeakerArrangement k40Cine
Definition vstspeaker.h:130
Speaker getSpeaker(const SpeakerArrangement &arr, int32 index)
Definition vstspeaker.h:515
const SpeakerArrangement k61Cine
Definition vstspeaker.h:144
const SpeakerArrangement k60Music
Definition vstspeaker.h:146
const SpeakerArrangement k50_4
Definition vstspeaker.h:216
const SpeakerArrangement k70_2
Definition vstspeaker.h:223
const SpeakerArrangement k90_6
Definition vstspeaker.h:261
const SpeakerArrangement k51_4
Definition vstspeaker.h:220
const SpeakerArrangement k71_4
Definition vstspeaker.h:236
const SpeakerArrangement k40Music
Definition vstspeaker.h:134
const SpeakerArrangement k30Music
Definition vstspeaker.h:126
const SpeakerArrangement k70_6
Definition vstspeaker.h:241
const SpeakerArrangement kStereo
L R.
Definition vstspeaker.h:110
const SpeakerArrangement k71Music
Definition vstspeaker.h:157
const SpeakerArrangement k60Cine
Definition vstspeaker.h:142
const SpeakerArrangement k50
Definition vstspeaker.h:138
const SpeakerArrangement k70_4
Definition vstspeaker.h:232
const SpeakerArrangement k71_2
Definition vstspeaker.h:227
const SpeakerArrangement k61Music
Definition vstspeaker.h:148
const SpeakerArrangement k30Cine
Definition vstspeaker.h:122
const SpeakerArrangement k91_6
Definition vstspeaker.h:266
Definition ivstattributes.h:28
@ kOutput
output bus
Definition ivstcomponent.h:76
@ kInput
input bus
Definition ivstcomponent.h:75
uint64 Speaker
Bit for one speaker.
Definition vsttypes.h:99
uint32 ParamID
parameter identifier
Definition vsttypes.h:75
TChar String128[128]
128 character UTF-16 string
Definition vsttypes.h:63
char16 TChar
UTF-16 character.
Definition vsttypes.h:62
double ParamValue
parameter value type
Definition vsttypes.h:74
int16 CtrlNumber
MIDI controller number (see ControllerNumbers for allowed values).
Definition vsttypes.h:77
static const ParamID kNoParamId
default for uninitialized parameter ID
Definition vsttypes.h:85
uint64 SpeakerArrangement
Bitset of speakers.
Definition vsttypes.h:98
@ kPitchBend
Pitch Bend Change.
Definition ivstmidicontrollers.h:105
@ kCtrlProgramChange
Program Change (use LegacyMIDICCOutEvent.value only).
Definition ivstmidicontrollers.h:110
@ kCountCtrlNumber
Count of Controller Number.
Definition ivstmidicontrollers.h:107
@ kCtrlPolyPressure
Definition ivstmidicontrollers.h:111
@ kCtrlQuarterFrame
LegacyMIDICCOutEvent.value2 for pressure).
Definition ivstmidicontrollers.h:113
@ kAfterTouch
After Touch (associated to Channel Pressure).
Definition ivstmidicontrollers.h:104
short int16
Definition ftypes.h:43
UStringBuffer< 128 > UString128
128 character UTF-16 string
Definition ustring.h:108
int16 char16
Definition ftypes.h:101
int int32
Definition ftypes.h:50
const FIDString kPlatformTypeNSView
NSView pointer. (Mac OS X).
Definition iplugview.h:70
char char8
Definition ftypes.h:93
int8 TUID[16]
plain UID type
Definition funknown.h:210
const char8 * FIDString
Definition ftypes.h:117
char int8
Definition ftypes.h:39
@ kResultOk
Definition funknown.h:193
@ kResultFalse
Definition funknown.h:195
@ kResultTrue
Definition funknown.h:194
UStringBuffer< 256 > UString256
256 character UTF-16 string
Definition ustring.h:109
unsigned char uint8
Definition ftypes.h:40
const FIDString kPlatformTypeX11EmbedWindowID
X11 Window ID. (X11).
Definition iplugview.h:79
const FIDString kPlatformTypeHWND
HWND handle. (Microsoft Windows).
Definition iplugview.h:62
int32 tresult
Definition ftypes.h:76
Definition juce_FloatVectorOperations.h:143
AudioChannelSet X
Definition juce_VST3Common.h:360
const LayoutPair layoutTable[]
Definition juce_VST3Common.h:368
Definition carla_juce.cpp:31
static int countUsedClientChannels(const std::vector< DynamicChannelMapping > &inputMap, const std::vector< DynamicChannelMapping > &outputMap)
Definition juce_VST3Common.h:573
static Steinberg::Vst::SpeakerArrangement getVst3SpeakerArrangement(const AudioChannelSet &channels) noexcept
Definition juce_VST3Common.h:453
InterfaceResultWithDeferredAddRef testForMultiple(ToTest &, const Steinberg::TUID)
Definition juce_VST3Common.h:140
static int countValidBuses(Steinberg::Vst::AudioBusBuffers *buffers, int32 num)
Definition juce_VST3Common.h:608
static AudioChannelSet::ChannelType getChannelType(Steinberg::Vst::SpeakerArrangement arr, Steinberg::Vst::Speaker type) noexcept
Definition juce_VST3Common.h:287
bool doUIDsMatch(const Steinberg::TUID a, const Steinberg::TUID b) noexcept
Definition juce_VST3Common.h:48
InterfaceResultWithDeferredAddRef testFor(ToTest &toTest, const Steinberg::TUID targetIID, SharedBase< CommonClassType, SourceClassType >)
Definition juce_VST3Common.h:121
constexpr Type jmin(Type a, Type b)
Definition juce_MathsFunctions.h:106
juce::String toString(const Steinberg::char8 *string) noexcept
Definition juce_VST3Common.h:159
void toString128(Steinberg::Vst::String128 result, const char *source)
Definition juce_VST3Common.h:168
unsigned int uint32
Definition juce_MathsFunctions.h:45
signed short int16
Definition juce_MathsFunctions.h:39
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Definition juce_MathsFunctions.h:262
long long int64
Definition juce_MathsFunctions.h:54
AudioChannelSet getChannelSetForSpeakerArrangement(Steinberg::Vst::SpeakerArrangement arr) noexcept
Definition juce_VST3Common.h:478
jack_client_t client jack_client_t client jack_client_t client jack_client_t JackInfoShutdownCallback void arg jack_client_t jack_port_t port void func jack_client_t const char const char unsigned long flags const jack_port_t port jack_client_t jack_port_id_t port_id const jack_port_t const char port_name const jack_port_t port void * ptr
Definition juce_linux_JackAudio.cpp:79
static Steinberg::Vst::Speaker getSpeakerType(const AudioChannelSet &set, AudioChannelSet::ChannelType type) noexcept
Definition juce_VST3Common.h:200
static bool validateLayouts(Iterator first, Iterator last, const std::vector< DynamicChannelMapping > &map)
Definition juce_VST3Common.h:617
int countNumberOfBits(uint32 n) noexcept
Definition juce_MathsFunctions.h:551
static Array< AudioChannelSet::ChannelType > getSpeakerOrder(Steinberg::Vst::SpeakerArrangement arr)
Definition juce_VST3Common.h:426
signed int int32
Definition juce_MathsFunctions.h:43
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Definition juce_MathsFunctions.h:279
static Steinberg::Vst::SpeakerArrangement getArrangementForBus(Steinberg::Vst::IAudioProcessor *processor, bool isInput, int busIndex)
Definition juce_VST3Common.h:188
bool isLayoutTableValid()
Definition juce_VST3Common.h:406
auto & getAudioBusPointer(detail::Tag< float >, Steinberg::Vst::AudioBusBuffers &data)
Definition juce_VST3Common.h:570
unsigned char uint8
Definition juce_MathsFunctions.h:37
int roundToInt(const FloatType value) noexcept
Definition juce_MathsFunctions.h:465
jack_client_t * client
Definition juce_linux_JackAudio.cpp:57
constexpr int numElementsInArray(Type(&)[N]) noexcept
Definition juce_MathsFunctions.h:344
Definition juce_Uuid.h:141
#define true
Definition ordinals.h:82
Definition ivstaudioprocessor.h:192
int32 numChannels
number of audio channels in bus
Definition ivstaudioprocessor.h:196
Sample64 ** channelBuffers64
sample buffers to process with 64-bit precision
Definition ivstaudioprocessor.h:201
uint64 silenceFlags
Bitset of silence state per channel.
Definition ivstaudioprocessor.h:197
Sample32 ** channelBuffers32
sample buffers to process with 32-bit precision
Definition ivstaudioprocessor.h:200
@ kMidiSysEx
for MIDI system exclusive message
Definition ivstevents.h:79
Definition ivstevents.h:143
@ kScaleEvent
is ScaleEvent
Definition ivstevents.h:168
@ kNoteExpressionValueEvent
is NoteExpressionValueEvent
Definition ivstevents.h:165
@ kPolyPressureEvent
is PolyPressureEvent
Definition ivstevents.h:164
@ kNoteExpressionTextEvent
is NoteExpressionTextEvent
Definition ivstevents.h:166
@ kNoteOffEvent
is NoteOffEvent
Definition ivstevents.h:162
@ kChordEvent
is ChordEvent
Definition ivstevents.h:167
@ kNoteOnEvent
is NoteOnEvent
Definition ivstevents.h:161
@ kLegacyMIDICCOutEvent
is LegacyMIDICCOutEvent
Definition ivstevents.h:169
@ kDataEvent
is DataEvent
Definition ivstevents.h:163
Definition ivstevents.h:130
Definition ivstaudioprocessor.h:214
Definition misc.c:36
Definition juce_Atomic.h:42
Definition juce_AudioProcessor.h:311
Array< AudioChannelSet > outputBuses
Definition juce_AudioProcessor.h:316
Array< AudioChannelSet > inputBuses
Definition juce_AudioProcessor.h:313
Definition juce_VST3Common.h:497
static std::vector< int > makeChannelIndices(const AudioChannelSet &juceArrangement)
Definition juce_VST3Common.h:523
bool isActive() const
Definition juce_VST3Common.h:512
void setActive(bool x)
Definition juce_VST3Common.h:511
ChannelMapping(const AudioChannelSet &layout, bool activeIn)
Definition juce_VST3Common.h:498
ChannelMapping(const AudioChannelSet &layout)
Definition juce_VST3Common.h:501
size_t size() const
Definition juce_VST3Common.h:509
int getJuceChannelForVst3Channel(int vst3Channel) const
Definition juce_VST3Common.h:507
std::vector< int > indices
Definition juce_VST3Common.h:535
ChannelMapping(const AudioProcessor::Bus &bus)
Definition juce_VST3Common.h:504
bool active
Definition juce_VST3Common.h:536
Definition juce_VST3Common.h:1630
virtual void restartComponentOnMessageThread(int32 flags)=0
Definition juce_VST3Common.h:1559
Steinberg::Vst::ParamValue paramValue
Definition juce_VST3Common.h:1561
Steinberg::Vst::CtrlNumber controllerNumber
Definition juce_VST3Common.h:1560
Definition juce_MidiBuffer.h:37
const uint8 * data
Definition juce_MidiBuffer.h:52
int samplePosition
Definition juce_MidiBuffer.h:58
MidiMessage getMessage() const
Definition juce_MidiBuffer.h:49
Definition juce_VST3Common.h:118
Definition juce_VST3Common.h:117
Definition juce_VST3Common.h:354
std::initializer_list< AudioChannelSet::ChannelType > channelOrder
Definition juce_VST3Common.h:356
Steinberg::Vst::SpeakerArrangement arrangement
Definition juce_VST3Common.h:355
Definition juce_Rectangle.h:33
RECT const char void(* callback)(const char *droppath))) SWELL_API_DEFINE(BOOL
Definition swell-functions.h:1004
uch * p
Definition crypt.c:594
b
Definition crypt.c:628
int result
Definition process.c:1455
typedef int(UZ_EXP MsgFn)()
#define void
Definition unzip.h:396
#define const
Definition zconf.h:137