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
pluginterfacesupport.cpp
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2// Project : VST SDK
3//
4// Category : Helpers
5// Filename : public.sdk/source/vst/hosting/pluginterfacesupport.cpp
6// Created by : Steinberg, 11/2018.
7// Description : VST 3 hostclasses, example implementations for IPlugInterfaceSupport
8//
9//-----------------------------------------------------------------------------
10// LICENSE
11// (c) 2023, Steinberg Media Technologies GmbH, All Rights Reserved
12//-----------------------------------------------------------------------------
13// Redistribution and use in source and binary forms, with or without modification,
14// are permitted provided that the following conditions are met:
15//
16// * Redistributions of source code must retain the above copyright notice,
17// this list of conditions and the following disclaimer.
18// * Redistributions in binary form must reproduce the above copyright notice,
19// this list of conditions and the following disclaimer in the documentation
20// and/or other materials provided with the distribution.
21// * Neither the name of the Steinberg Media Technologies nor the names of its
22// contributors may be used to endorse or promote products derived from this
23// software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
26// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34// OF THE POSSIBILITY OF SUCH DAMAGE.
35//-----------------------------------------------------------------------------
36
38
43
44#include <algorithm>
45
46//-----------------------------------------------------------------------------
47namespace Steinberg {
48namespace Vst {
49
50//-----------------------------------------------------------------------------
51PlugInterfaceSupport::PlugInterfaceSupport ()
52{
53 FUNKNOWN_CTOR
54 // add minimum set
55
56 //---VST 3.0.0--------------------------------
57 addPlugInterfaceSupported (IComponent::iid);
58 addPlugInterfaceSupported (IAudioProcessor::iid);
59 addPlugInterfaceSupported (IEditController::iid);
60 addPlugInterfaceSupported (IConnectionPoint::iid);
61
62 addPlugInterfaceSupported (IUnitInfo::iid);
63 addPlugInterfaceSupported (IUnitData::iid);
64 addPlugInterfaceSupported (IProgramListData::iid);
65
66 //---VST 3.0.1--------------------------------
67 addPlugInterfaceSupported (IMidiMapping::iid);
68
69 //---VST 3.1----------------------------------
70 addPlugInterfaceSupported (IEditController2::iid);
71
72 /*
73 //---VST 3.0.2--------------------------------
74 addPlugInterfaceSupported (IParameterFinder::iid);
75
76 //---VST 3.1----------------------------------
77 addPlugInterfaceSupported (IAudioPresentationLatency::iid);
78
79 //---VST 3.5----------------------------------
80 addPlugInterfaceSupported (IKeyswitchController::iid);
81 addPlugInterfaceSupported (IContextMenuTarget::iid);
82 addPlugInterfaceSupported (IEditControllerHostEditing::iid);
83 addPlugInterfaceSupported (IXmlRepresentationController::iid);
84 addPlugInterfaceSupported (INoteExpressionController::iid);
85
86 //---VST 3.6.5--------------------------------
87 addPlugInterfaceSupported (ChannelContext::IInfoListener::iid);
88 addPlugInterfaceSupported (IPrefetchableSupport::iid);
89 addPlugInterfaceSupported (IAutomationState::iid);
90
91 //---VST 3.6.11--------------------------------
92 addPlugInterfaceSupported (INoteExpressionPhysicalUIMapping::iid);
93
94 //---VST 3.6.12--------------------------------
95 addPlugInterfaceSupported (IMidiLearn::iid);
96
97 //---VST 3.7-----------------------------------
98 addPlugInterfaceSupported (IProcessContextRequirements::iid);
99 addPlugInterfaceSupported (IParameterFunctionName::iid);
100 addPlugInterfaceSupported (IProgress::iid);
101 */
102}
103
104//-----------------------------------------------------------------------------
105tresult PLUGIN_API PlugInterfaceSupport::isPlugInterfaceSupported (const TUID _iid)
106{
107 auto uid = FUID::fromTUID (_iid);
108 if (std::find (mFUIDArray.begin (), mFUIDArray.end (), uid) != mFUIDArray.end ())
109 return kResultTrue;
110 return kResultFalse;
111}
112
113//-----------------------------------------------------------------------------
114void PlugInterfaceSupport::addPlugInterfaceSupported (const TUID _iid)
115{
116 mFUIDArray.push_back (FUID::fromTUID (_iid));
117}
118
119//-----------------------------------------------------------------------------
120bool PlugInterfaceSupport::removePlugInterfaceSupported (const TUID _iid)
121{
122 auto uid = FUID::fromTUID (_iid);
123 auto it = std::find (mFUIDArray.begin (), mFUIDArray.end (), uid);
124 if (it == mFUIDArray.end ())
125 return false;
126 mFUIDArray.erase (it);
127 return true;
128}
129
130IMPLEMENT_FUNKNOWN_METHODS (PlugInterfaceSupport, IPlugInterfaceSupport, IPlugInterfaceSupport::iid)
131
132//-----------------------------------------------------------------------------
133} // Vst
134} // Steinberg
tresult PLUGIN_API isPlugInterfaceSupported(const TUID _iid) SMTG_OVERRIDE
Returns kResultTrue if the associated interface to the given _iid is supported/used by the host.
T find(T... args)