LMMS
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 implementations for IHostApplication, IAttributeList and IMessage
8//
9//-----------------------------------------------------------------------------
10// LICENSE
11// (c) 2021, 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
40#include "base/source/fstring.h"
42#include <map>
43
44namespace Steinberg {
45namespace Vst {
46
47//------------------------------------------------------------------------
52{
53public:
56
57 //--- IHostApplication ---------------
59 tresult PLUGIN_API createInstance (TUID cid, TUID _iid, void** obj) SMTG_OVERRIDE;
60
62
64
65protected:
67};
68
69class HostAttribute;
70//------------------------------------------------------------------------
75{
76public:
78 virtual ~HostAttributeList ();
79
80 tresult PLUGIN_API setInt (AttrID aid, int64 value) SMTG_OVERRIDE;
81 tresult PLUGIN_API getInt (AttrID aid, int64& value) SMTG_OVERRIDE;
82 tresult PLUGIN_API setFloat (AttrID aid, double value) SMTG_OVERRIDE;
83 tresult PLUGIN_API getFloat (AttrID aid, double& value) SMTG_OVERRIDE;
84 tresult PLUGIN_API setString (AttrID aid, const TChar* string) SMTG_OVERRIDE;
85 tresult PLUGIN_API getString (AttrID aid, TChar* string, uint32 sizeInBytes) SMTG_OVERRIDE;
86 tresult PLUGIN_API setBinary (AttrID aid, const void* data, uint32 sizeInBytes) SMTG_OVERRIDE;
87 tresult PLUGIN_API getBinary (AttrID aid, const void*& data, uint32& sizeInBytes) SMTG_OVERRIDE;
88
90protected:
91 void removeAttrID (AttrID aid);
92 std::map<String, HostAttribute*> list;
93};
94
95//------------------------------------------------------------------------
99class HostMessage : public IMessage
100{
101public:
102 HostMessage ();
103 virtual ~HostMessage ();
104
105 const char* PLUGIN_API getMessageID () SMTG_OVERRIDE;
106 void PLUGIN_API setMessageID (const char* messageID) SMTG_OVERRIDE;
108
110protected:
113};
114
115//------------------------------------------------------------------------
116} // namespace Vst
117} // namespace Steinberg
Definition smartpointer.h:44
virtual ~HostApplication()
Definition hostclasses.h:55
IPtr< PlugInterfaceSupport > mPlugInterfaceSupport
Definition hostclasses.h:66
tresult PLUGIN_API createInstance(TUID cid, TUID _iid, void **obj) SMTG_OVERRIDE
Definition hostclasses.cpp:61
HostApplication()
Definition hostclasses.cpp:45
DECLARE_FUNKNOWN_METHODS PlugInterfaceSupport * getPlugInterfaceSupport() const
Definition hostclasses.h:63
tresult PLUGIN_API getName(String128 name) SMTG_OVERRIDE
Definition hostclasses.cpp:53
Definition hostclasses.cpp:155
Definition hostclasses.h:75
tresult PLUGIN_API getString(AttrID aid, TChar *string, uint32 sizeInBytes) SMTG_OVERRIDE
Definition hostclasses.cpp:295
tresult PLUGIN_API setString(AttrID aid, const TChar *string) SMTG_OVERRIDE
Definition hostclasses.cpp:286
HostAttributeList()
Definition hostclasses.cpp:217
virtual ~HostAttributeList()
Definition hostclasses.cpp:223
tresult PLUGIN_API setFloat(AttrID aid, double value) SMTG_OVERRIDE
Definition hostclasses.cpp:266
std::map< String, HostAttribute * > list
Definition hostclasses.h:92
tresult PLUGIN_API getFloat(AttrID aid, double &value) SMTG_OVERRIDE
Definition hostclasses.cpp:274
tresult PLUGIN_API setInt(AttrID aid, int64 value) SMTG_OVERRIDE
Definition hostclasses.cpp:246
void removeAttrID(AttrID aid)
Definition hostclasses.cpp:235
tresult PLUGIN_API getInt(AttrID aid, int64 &value) SMTG_OVERRIDE
Definition hostclasses.cpp:254
tresult PLUGIN_API setBinary(AttrID aid, const void *data, uint32 sizeInBytes) SMTG_OVERRIDE
Definition hostclasses.cpp:309
tresult PLUGIN_API getBinary(AttrID aid, const void *&data, uint32 &sizeInBytes) SMTG_OVERRIDE
Definition hostclasses.cpp:317
void PLUGIN_API setMessageID(const char *messageID) SMTG_OVERRIDE
Definition hostclasses.cpp:130
virtual ~HostMessage()
Definition hostclasses.cpp:115
HostAttributeList * attributeList
Definition hostclasses.h:112
HostMessage()
Definition hostclasses.cpp:109
const char *PLUGIN_API getMessageID() SMTG_OVERRIDE
Definition hostclasses.cpp:124
char * messageId
Definition hostclasses.h:111
IAttributeList *PLUGIN_API getAttributes() SMTG_OVERRIDE
Definition hostclasses.cpp:144
Definition ivstattributes.h:41
const char * AttrID
Definition ivstattributes.h:44
Definition ivsthostapplication.h:36
Definition ivstmessage.h:41
Definition pluginterfacesupport.h:52
#define SMTG_OVERRIDE
Definition fplatform.h:241
#define FUNKNOWN_DTOR
Definition funknown.h:127
#define DECLARE_FUNKNOWN_METHODS
Definition funknown.h:89
static PuglViewHint int value
Definition pugl.h:1708
static const char * name
Definition pugl.h:1582
JSAMPIMAGE data
Definition jpeglib.h:945
Definition ivstattributes.h:28
TChar String128[128]
128 character UTF-16 string
Definition vsttypes.h:63
char16 TChar
UTF-16 character.
Definition vsttypes.h:62
Definition baseiids.cpp:43
int8 TUID[16]
plain UID type
Definition funknown.h:210
long long int64
Definition ftypes.h:66
int32 tresult
Definition ftypes.h:76
unsigned int uint32
Definition ftypes.h:51