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
hostclasses.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2// Project : VST SDK
3//
4// Category : Helpers
5// Filename : public.sdk/source/vst/hosting/hostclasses.h
6// Created by : Steinberg, 03/05/2008.
7// Description : VST 3 hostclasses, example impl. for IHostApplication, IAttributeList and IMessage
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
41#include <map>
42#include <memory>
43#include <string>
44
45namespace Steinberg {
46namespace Vst {
47
48//------------------------------------------------------------------------
53{
54public:
56 virtual ~HostApplication () noexcept {FUNKNOWN_DTOR}
57
58 //--- IHostApplication ---------------
59 tresult PLUGIN_API getName (String128 name) override;
60 tresult PLUGIN_API createInstance (TUID cid, TUID _iid, void** obj) override;
61
62 DECLARE_FUNKNOWN_METHODS
63
64 PlugInterfaceSupport* getPlugInterfaceSupport () const { return mPlugInterfaceSupport; }
65
66private:
67 IPtr<PlugInterfaceSupport> mPlugInterfaceSupport;
68};
69
70//------------------------------------------------------------------------
75{
76public:
78 static IPtr<IAttributeList> make ();
79
80 tresult PLUGIN_API setInt (AttrID aid, int64 value) override;
81 tresult PLUGIN_API getInt (AttrID aid, int64& value) override;
82 tresult PLUGIN_API setFloat (AttrID aid, double value) override;
83 tresult PLUGIN_API getFloat (AttrID aid, double& value) override;
84 tresult PLUGIN_API setString (AttrID aid, const TChar* string) override;
85 tresult PLUGIN_API getString (AttrID aid, TChar* string, uint32 sizeInBytes) override;
86 tresult PLUGIN_API setBinary (AttrID aid, const void* data, uint32 sizeInBytes) override;
87 tresult PLUGIN_API getBinary (AttrID aid, const void*& data, uint32& sizeInBytes) override;
88
89 virtual ~HostAttributeList () noexcept;
90 DECLARE_FUNKNOWN_METHODS
91private:
93
94 struct Attribute;
96};
97
98//------------------------------------------------------------------------
102class HostMessage final : public IMessage
103{
104public:
105 HostMessage ();
106 virtual ~HostMessage () noexcept;
107
108 const char* PLUGIN_API getMessageID () override;
109 void PLUGIN_API setMessageID (const char* messageID) override;
110 IAttributeList* PLUGIN_API getAttributes () override;
111
112 DECLARE_FUNKNOWN_METHODS
113private:
114 char* messageId {nullptr};
115 IPtr<IAttributeList> attributeList;
116};
117
118//------------------------------------------------------------------------
119} // namespace Vst
120} // namespace Steinberg
IPtr - Smart pointer template class.
Implementation's example of IHostApplication.
Definition hostclasses.h:53
tresult PLUGIN_API getName(String128 name) override
Gets host application name.
tresult PLUGIN_API createInstance(TUID cid, TUID _iid, void **obj) override
Creates host object (e.g.
Example, ready to use implementation of IAttributeList.
Definition hostclasses.h:75
tresult PLUGIN_API getInt(AttrID aid, int64 &value) override
Gets integer value.
tresult PLUGIN_API setString(AttrID aid, const TChar *string) override
Sets string value (UTF16) (must be null-terminated!).
tresult PLUGIN_API getBinary(AttrID aid, const void *&data, uint32 &sizeInBytes) override
Gets binary data.
static IPtr< IAttributeList > make()
make a new attribute list instance
tresult PLUGIN_API setInt(AttrID aid, int64 value) override
Sets integer value.
tresult PLUGIN_API setFloat(AttrID aid, double value) override
Sets float value.
tresult PLUGIN_API getString(AttrID aid, TChar *string, uint32 sizeInBytes) override
Gets string value (UTF16).
tresult PLUGIN_API setBinary(AttrID aid, const void *data, uint32 sizeInBytes) override
Sets binary data.
tresult PLUGIN_API getFloat(AttrID aid, double &value) override
Gets float value.
Example implementation of IMessage.
IAttributeList *PLUGIN_API getAttributes() override
Returns the attribute list associated to the message.
const char *PLUGIN_API getMessageID() override
Returns the message ID (for example "TextMessage").
Attribute list used in IMessage and IStreamAttributes: Vst::IAttributeList.
Basic host callback interface: Vst::IHostApplication.
Private plug-in message: Vst::IMessage.
Definition ivstmessage.h:41
Example implementation of IPlugInterfaceSupport.
char TUID[16]
plain UID type
Definition funknown.h:209
TChar String128[128]
128 character UTF-16 string
Definition vsttypes.h:69
char16 TChar
UTF-16 character.
Definition vsttypes.h:68