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
vstcomponentbase.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2// Project : VST SDK
3//
4// Category : Helpers
5// Filename : public.sdk/source/vst/vstcomponentbase.h
6// Created by : Steinberg, 05/2005
7// Description : Base class for Component and Edit Controller
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#include "base/source/fobject.h"
43
44//------------------------------------------------------------------------
45namespace Steinberg {
46namespace Vst {
47
48//------------------------------------------------------------------------
52class ComponentBase: public FObject,
53 public IPluginBase,
54 public IConnectionPoint
55{
56public:
57//------------------------------------------------------------------------
59 ~ComponentBase () override;
60
61 //--- Internal Methods------
63 FUnknown* getHostContext () const { return hostContext; }
64
67 IConnectionPoint* getPeer () const { return peerConnection; }
68
70 IMessage* allocateMessage () const;
71
73 tresult sendMessage (IMessage* message) const;
74
77 tresult sendTextMessage (const char8* text) const;
78
80 tresult sendMessageID (const char8* messageID) const;
81
83 virtual tresult receiveText (const char8* text);
84
85 //---from IPluginBase------
86 tresult PLUGIN_API initialize (FUnknown* context) SMTG_OVERRIDE;
87 tresult PLUGIN_API terminate () SMTG_OVERRIDE;
88
89 //---from IConnectionPoint-----------
90 tresult PLUGIN_API connect (IConnectionPoint* other) SMTG_OVERRIDE;
91 tresult PLUGIN_API disconnect (IConnectionPoint* other) SMTG_OVERRIDE;
92 tresult PLUGIN_API notify (IMessage* message) SMTG_OVERRIDE;
93
94 //---Interface------
95 OBJ_METHODS (ComponentBase, FObject)
101
102//------------------------------------------------------------------------
103protected:
104 IPtr<FUnknown> hostContext;
105 IPtr<IConnectionPoint> peerConnection;
106};
107
108//------------------------------------------------------------------------
109} // namespace Vst
110} // namespace Steinberg
Implements FUnknown and IDependent.
Definition fobject.h:84
The basic interface of all interfaces.
Definition funknown.h:375
Basic interface to a plug-in component: IPluginBase.
Definition ipluginbase.h:37
IPtr - Smart pointer template class.
Base class for VST 3 Component and Edit Controller.
tresult PLUGIN_API notify(IMessage *message) SMTG_OVERRIDE
Called when a message has been sent from the connection point to this.
IConnectionPoint * getPeer() const
Returns the peer for the messaging communication (you can only use IConnectionPoint::notify for commu...
IMessage * allocateMessage() const
Allocates a message instance (do not forget to release it).
tresult PLUGIN_API initialize(FUnknown *context) SMTG_OVERRIDE
The host passes a number of interfaces as context to initialize the plug-in class.
FUnknown * getHostContext() const
Returns the hostContext (set by the host during initialize call).
tresult PLUGIN_API terminate() SMTG_OVERRIDE
This function is called before the plug-in is unloaded and can be used for cleanups.
tresult sendTextMessage(const char8 *text) const
Sends a simple text message to the peer (max 255 characters).
virtual tresult receiveText(const char8 *text)
Receives a simple text message from the peer (max 255 characters).
tresult sendMessage(IMessage *message) const
Sends the given message to the peer.
tresult sendMessageID(const char8 *messageID) const
Sends a message with a given ID without any other payload.
tresult PLUGIN_API disconnect(IConnectionPoint *other) SMTG_OVERRIDE
Disconnects a given connection point from this.
Connect a component with another one: Vst::IConnectionPoint.
Definition ivstmessage.h:73
Private plug-in message: Vst::IMessage.
Definition ivstmessage.h:41
Basic Object implementing FUnknown.
#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