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
vstcomponent.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2// Project : VST SDK
3//
4// Category : Helpers
5// Filename : public.sdk/source/vst/vstcomponent.h
6// Created by : Steinberg, 04/2005
7// Description : Basic VST Plug-in Implementation
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
37#pragma once
38
42
43//------------------------------------------------------------------------
44namespace Steinberg {
45namespace Vst {
46
47//------------------------------------------------------------------------
52class Component : public ComponentBase, public IComponent
53{
54public:
55//------------------------------------------------------------------------
57 Component ();
58
59 //---Internal Methods-------
61 void setControllerClass (const FUID& cid) { controllerClass = cid; }
62 void setControllerClass (const TUID& cid) { controllerClass = FUID::fromTUID (cid); }
63
65 tresult removeAudioBusses ();
66
68 tresult removeEventBusses ();
69
72 tresult renameBus (MediaType type, BusDirection dir, int32 index, const String128 newName);
73
74 //---from IComponent--------
75 tresult PLUGIN_API getControllerClassId (TUID classID) SMTG_OVERRIDE;
76 tresult PLUGIN_API setIoMode (IoMode mode) SMTG_OVERRIDE;
77 int32 PLUGIN_API getBusCount (MediaType type, BusDirection dir) SMTG_OVERRIDE;
78 tresult PLUGIN_API getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& info) SMTG_OVERRIDE;
79 tresult PLUGIN_API getRoutingInfo (RoutingInfo& inInfo, RoutingInfo& outInfo) SMTG_OVERRIDE;
80 tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, int32 index, TBool state) SMTG_OVERRIDE;
81 tresult PLUGIN_API setActive (TBool state) SMTG_OVERRIDE;
82 tresult PLUGIN_API setState (IBStream* state) SMTG_OVERRIDE;
83 tresult PLUGIN_API getState (IBStream* state) SMTG_OVERRIDE;
84
85 //---from ComponentBase------
86 tresult PLUGIN_API initialize (FUnknown* context) SMTG_OVERRIDE;
87 tresult PLUGIN_API terminate () SMTG_OVERRIDE;
88
89 //---Interface---------
90 OBJ_METHODS (Component, ComponentBase)
92 DEF_INTERFACE (IComponent)
93 END_DEFINE_INTERFACES (ComponentBase)
94 REFCOUNT_METHODS (ComponentBase)
95
96//------------------------------------------------------------------------
97protected:
98 FUID controllerClass;
99 BusList audioInputs;
100 BusList audioOutputs;
101 BusList eventInputs;
102 BusList eventOutputs;
103
104 BusList* getBusList (MediaType type, BusDirection dir);
105 tresult removeAllBusses ();
106};
107
108//------------------------------------------------------------------------
109// some Helper functions....
110//------------------------------------------------------------------------
111
114tresult getSpeakerChannelIndex (SpeakerArrangement arrangement, uint64 speaker, int32& channel);
115
116//------------------------------------------------------------------------
117} // namespace Vst
118} // namespace Steinberg
Handling 16 Byte Globally Unique Identifiers.
Definition funknown.h:241
The basic interface of all interfaces.
Definition funknown.h:375
Base class for streams.
Definition ibstream.h:30
Base class for VST 3 Component and Edit Controller.
Default implementation for a VST 3 Component.
int32 PLUGIN_API getBusCount(MediaType type, BusDirection dir) SMTG_OVERRIDE
Called after the plug-in is initialized.
tresult PLUGIN_API getState(IBStream *state) SMTG_OVERRIDE
Retrieves complete state of component.
tresult PLUGIN_API getRoutingInfo(RoutingInfo &inInfo, RoutingInfo &outInfo) SMTG_OVERRIDE
Retrieves routing information (to be implemented when more than one regular input or output bus exist...
tresult PLUGIN_API setState(IBStream *state) SMTG_OVERRIDE
Sets complete state of component.
tresult PLUGIN_API setActive(TBool state) SMTG_OVERRIDE
Activates / deactivates the component.
tresult PLUGIN_API initialize(FUnknown *context) SMTG_OVERRIDE
The host passes a number of interfaces as context to initialize the plug-in class.
tresult PLUGIN_API setIoMode(IoMode mode) SMTG_OVERRIDE
Called before 'initialize' to set the component usage (optional).
tresult PLUGIN_API activateBus(MediaType type, BusDirection dir, int32 index, TBool state) SMTG_OVERRIDE
Called upon (de-)activating a bus in the host application.
tresult PLUGIN_API getControllerClassId(TUID classID) SMTG_OVERRIDE
Called before initializing the component to get information about the controller class.
tresult PLUGIN_API getBusInfo(MediaType type, BusDirection dir, int32 index, BusInfo &info) SMTG_OVERRIDE
Called after the plug-in is initialized.
void setControllerClass(const FUID &cid)
Sets the controller Class ID associated to its component.
tresult PLUGIN_API terminate() SMTG_OVERRIDE
This function is called before the plug-in is unloaded and can be used for cleanups.
tresult renameBus(MediaType type, BusDirection dir, int32 index, const String128 newName)
Renames a specific bus.
tresult removeAudioBusses()
Removes all Audio Busses.
tresult removeEventBusses()
Removes all Event Busses.
Component base interface: Vst::IComponent.
#define DEFINE_INTERFACES
Start defining interfaces.
Definition fobject.h:387
#define DEF_INTERFACE(InterfaceName)
Add a interfaces.
Definition fobject.h:394
#define END_DEFINE_INTERFACES(BaseClass)
End defining interfaces.
Definition fobject.h:400
#define REFCOUNT_METHODS(BaseClass)
Delegate refcount functions to BaseClass.
Definition fobject.h:360
int32 IoMode
I/O mode (see vst3IoMode)
Definition vsttypes.h:78
TChar String128[128]
128 character UTF-16 string
Definition vsttypes.h:69
tresult getSpeakerChannelIndex(SpeakerArrangement arrangement, uint64 speaker, int32 &channel)
Gets the channel index of a given speaker in a arrangement, returns kResultFalse if speaker not part ...
int32 BusDirection
bus direction (in/out)
Definition vsttypes.h:76
uint64 SpeakerArrangement
Bitset of speakers.
Definition vsttypes.h:104
int32 MediaType
media type (audio/event)
Definition vsttypes.h:75