nongnu.org/gsequencer


gsequencer 7.0.5
Advanced Gtk+ Sequencer
hostcontext.h
Go to the documentation of this file.
1//------------------------------------------------------------------------
2// Project : SDK Base
3// Version : 1.0
4//
5// Category : Helpers
6// Filename : base/source/updatehandler.h
7// Created by : Steinberg, 2008
8// Description :
9//
10//-----------------------------------------------------------------------------
11// LICENSE
12// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
13//-----------------------------------------------------------------------------
14// Redistribution and use in source and binary forms, with or without modification,
15// are permitted provided that the following conditions are met:
16//
17// * Redistributions of source code must retain the above copyright notice,
18// this list of conditions and the following disclaimer.
19// * Redistributions in binary form must reproduce the above copyright notice,
20// this list of conditions and the following disclaimer in the documentation
21// and/or other materials provided with the distribution.
22// * Neither the name of the Steinberg Media Technologies nor the names of its
23// contributors may be used to endorse or promote products derived from this
24// software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
27// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
30// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
34// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
35// OF THE POSSIBILITY OF SUCH DAMAGE.
36//-----------------------------------------------------------------------------
37
38/* GSequencer - Advanced GTK Sequencer
39 * Copyright (C) 2005-2021 Joël Krähemann
40 *
41 * This file is part of GSequencer.
42 *
43 * GSequencer is free software: you can redistribute it and/or modify
44 * it under the terms of the GNU General Public License as published by
45 * the Free Software Foundation, either version 3 of the License, or
46 * (at your option) any later version.
47 *
48 * GSequencer is distributed in the hope that it will be useful,
49 * but WITHOUT ANY WARRANTY; without even the implied warranty of
50 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 * GNU General Public License for more details.
52 *
53 * You should have received a copy of the GNU General Public License
54 * along with GSequencer. If not, see <http://www.gnu.org/licenses/>.
55 */
56
57#ifndef __HOST_CONTEXT_H__
58#define __HOST_CONTEXT_H__
59
60#pragma once
61
62#include <pluginterfaces/base/conststringtable.h>
63#include <pluginterfaces/base/funknown.h>
64#include <public.sdk/source/vst/hosting/pluginterfacesupport.h>
65#include <base/source/fstring.h>
66#include <pluginterfaces/vst/ivsthostapplication.h>
67#include <base/source/updatehandler.h>
68#include <map>
69
70using namespace Steinberg::Vst;
71
72namespace Steinberg
73{
74 namespace Vst {
75//------------------------------------------------------------------------
79class HostApplication : public Steinberg::Vst::IHostApplication
80{
81public:
83 virtual ~HostApplication () { FUNKNOWN_DTOR }
84
85 //--- IHostApplication ---------------
86 Steinberg::tresult PLUGIN_API getName (Steinberg::Vst::String128 name) SMTG_OVERRIDE;
87 Steinberg::tresult PLUGIN_API createInstance (Steinberg::TUID cid, Steinberg::TUID _iid, void** obj) SMTG_OVERRIDE;
88
89 DECLARE_FUNKNOWN_METHODS
90
91 Steinberg::Vst::PlugInterfaceSupport* getPlugInterfaceSupport () const { return mPlugInterfaceSupport; }
92
93protected:
94 Steinberg::IPtr<Steinberg::Vst::PlugInterfaceSupport> mPlugInterfaceSupport;
95};
96
97class HostAttribute;
98//------------------------------------------------------------------------
102class HostAttributeList : public Steinberg::Vst::IAttributeList
103{
104public:
106 virtual ~HostAttributeList ();
107
108 Steinberg::tresult PLUGIN_API setInt (AttrID aid, Steinberg::int64 value) SMTG_OVERRIDE;
109 Steinberg::tresult PLUGIN_API getInt (AttrID aid, Steinberg::int64& value) SMTG_OVERRIDE;
110 Steinberg::tresult PLUGIN_API setFloat (AttrID aid, double value) SMTG_OVERRIDE;
111 Steinberg::tresult PLUGIN_API getFloat (AttrID aid, double& value) SMTG_OVERRIDE;
112 Steinberg::tresult PLUGIN_API setString (AttrID aid, const Steinberg::Vst::TChar* string) SMTG_OVERRIDE;
113 Steinberg::tresult PLUGIN_API getString (AttrID aid, Steinberg::Vst::TChar* string, Steinberg::uint32 sizeInBytes) SMTG_OVERRIDE;
114 Steinberg::tresult PLUGIN_API setBinary (AttrID aid, const void* data, Steinberg::uint32 sizeInBytes) SMTG_OVERRIDE;
115 Steinberg::tresult PLUGIN_API getBinary (AttrID aid, const void*& data, Steinberg::uint32& sizeInBytes) SMTG_OVERRIDE;
116
117 DECLARE_FUNKNOWN_METHODS
118protected:
119 void removeAttrID (AttrID aid);
120 std::map<Steinberg::String, HostAttribute*> list;
121};
122
123//------------------------------------------------------------------------
127class HostMessage : public Steinberg::Vst::IMessage
128{
129public:
130 HostMessage ();
131 virtual ~HostMessage ();
132
133 const char* PLUGIN_API getMessageID () SMTG_OVERRIDE;
134 void PLUGIN_API setMessageID (const char* messageID) SMTG_OVERRIDE;
135 Steinberg::Vst::IAttributeList* PLUGIN_API getAttributes () SMTG_OVERRIDE;
136
137 DECLARE_FUNKNOWN_METHODS
138protected:
141};
142 }
143}
144
145#endif /*__HOST_CONTEXT_H__*/
Definition hostcontext.h:80
virtual ~HostApplication()
Definition hostcontext.h:83
Steinberg::IPtr< Steinberg::Vst::PlugInterfaceSupport > mPlugInterfaceSupport
Definition hostcontext.h:94
Steinberg::tresult PLUGIN_API createInstance(Steinberg::TUID cid, Steinberg::TUID _iid, void **obj) SMTG_OVERRIDE
Definition hostcontext.cpp:85
HostApplication()
Definition hostcontext.cpp:65
DECLARE_FUNKNOWN_METHODS Steinberg::Vst::PlugInterfaceSupport * getPlugInterfaceSupport() const
Definition hostcontext.h:91
Steinberg::tresult PLUGIN_API getName(Steinberg::Vst::String128 name) SMTG_OVERRIDE
Definition hostcontext.cpp:73
Definition hostcontext.cpp:183
Definition hostcontext.h:103
HostAttributeList()
Definition hostcontext.cpp:245
Steinberg::tresult PLUGIN_API setBinary(AttrID aid, const void *data, Steinberg::uint32 sizeInBytes) SMTG_OVERRIDE
Definition hostcontext.cpp:337
virtual ~HostAttributeList()
Definition hostcontext.cpp:251
Steinberg::tresult PLUGIN_API getBinary(AttrID aid, const void *&data, Steinberg::uint32 &sizeInBytes) SMTG_OVERRIDE
Definition hostcontext.cpp:345
Steinberg::tresult PLUGIN_API setInt(AttrID aid, Steinberg::int64 value) SMTG_OVERRIDE
Definition hostcontext.cpp:274
Steinberg::tresult PLUGIN_API setFloat(AttrID aid, double value) SMTG_OVERRIDE
Definition hostcontext.cpp:294
Steinberg::tresult PLUGIN_API getFloat(AttrID aid, double &value) SMTG_OVERRIDE
Definition hostcontext.cpp:302
Steinberg::tresult PLUGIN_API getString(AttrID aid, Steinberg::Vst::TChar *string, Steinberg::uint32 sizeInBytes) SMTG_OVERRIDE
Definition hostcontext.cpp:323
Steinberg::tresult PLUGIN_API getInt(AttrID aid, Steinberg::int64 &value) SMTG_OVERRIDE
Definition hostcontext.cpp:282
void removeAttrID(AttrID aid)
Definition hostcontext.cpp:263
Steinberg::tresult PLUGIN_API setString(AttrID aid, const Steinberg::Vst::TChar *string) SMTG_OVERRIDE
Definition hostcontext.cpp:314
std::map< Steinberg::String, HostAttribute * > list
Definition hostcontext.h:120
Definition hostcontext.h:128
void PLUGIN_API setMessageID(const char *messageID) SMTG_OVERRIDE
Definition hostcontext.cpp:158
virtual ~HostMessage()
Definition hostcontext.cpp:143
HostAttributeList * attributeList
Definition hostcontext.h:140
HostMessage()
Definition hostcontext.cpp:137
const char *PLUGIN_API getMessageID() SMTG_OVERRIDE
Definition hostcontext.cpp:152
char * messageId
Definition hostcontext.h:139
Steinberg::Vst::IAttributeList *PLUGIN_API getAttributes() SMTG_OVERRIDE
Definition hostcontext.cpp:172
Definition hostcontext.cpp:62
Definition hostcontext.cpp:61