nongnu.org/gsequencer


gsequencer 7.0.5
Advanced Gtk+ Sequencer
componenthandler.h
Go to the documentation of this file.
1/* GSequencer - Advanced GTK Sequencer
2 * Copyright (C) 2005-2021 Joël Krähemann
3 *
4 * This file is part of GSequencer.
5 *
6 * GSequencer is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * GSequencer is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with GSequencer. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <pluginterfaces/base/conststringtable.h>
23#include <pluginterfaces/base/funknown.h>
24#include <pluginterfaces/vst/ivsteditcontroller.h>
25#include <public.sdk/source/vst/hosting/pluginterfacesupport.h>
26
27#include <ags/libags-vst.h>
28
29#include <mutex>
30
31namespace Ags
32{
33 namespace VstCAPI {
34
35 typedef AgsVstTResult (*ComponentHandlerBeginEdit)(AgsVstIComponentHandler *icomponent_handler, AgsVstParamID id, gpointer data);
36 typedef AgsVstTResult (*ComponentHandlerPerformEdit)(AgsVstIComponentHandler *icomponent_handler, AgsVstParamID id, AgsVstParamValue value_normalized, gpointer data);
37 typedef AgsVstTResult (*ComponentHandlerEndEdit)(AgsVstIComponentHandler *icomponent_handler, AgsVstParamID id, gpointer data);
38 typedef AgsVstTResult (*ComponentHandlerRestartComponent)(AgsVstIComponentHandler *icomponent_handler, gint32 flags, gpointer data);
39
41 {
43
44 void *callback;
45 void *data;
47 };
48
49 class ComponentHandler : public Steinberg::Vst::IComponentHandler
50 {
51 public:
53
54 virtual ~ComponentHandler () { FUNKNOWN_DTOR }
55
56 Steinberg::tresult PLUGIN_API beginEdit(Steinberg::Vst::ParamID id) override;
57
58 Steinberg::tresult PLUGIN_API performEdit(Steinberg::Vst::ParamID id, Steinberg::Vst::ParamValue valueNormalized) override;
59
60 Steinberg::tresult PLUGIN_API endEdit(Steinberg::Vst::ParamID id) override;
61
62 Steinberg::tresult PLUGIN_API restartComponent(Steinberg::int32 flags) override;
63
64 DECLARE_FUNKNOWN_METHODS
65
66 Steinberg::Vst::PlugInterfaceSupport* getPlugInterfaceSupport () const { return mPlugInterfaceSupport; }
67
68 int connectHandler(char *event_name, void *callback, void *data);
69 void disconnectHandler(int handler_id);
70
72
75
77
78protected:
79 Steinberg::IPtr<Steinberg::Vst::PlugInterfaceSupport> mPlugInterfaceSupport;
80 };
81
82 }
83}
gint32 AgsVstTResult
Definition ags_vst_ftypes.h:58
struct IComponentHandler AgsVstIComponentHandler
Definition ags_vst_iedit_controller.h:35
gdouble AgsVstParamValue
Definition ags_vst_types.h:51
guint32 AgsVstParamID
Definition ags_vst_types.h:52
Definition componenthandler.h:50
EventHandler * handler
Definition componenthandler.h:71
Steinberg::IPtr< Steinberg::Vst::PlugInterfaceSupport > mPlugInterfaceSupport
Definition componenthandler.h:79
virtual ~ComponentHandler()
Definition componenthandler.h:54
Steinberg::tresult PLUGIN_API performEdit(Steinberg::Vst::ParamID id, Steinberg::Vst::ParamValue valueNormalized) override
Definition componenthandler.cpp:87
void disconnectHandler(int handler_id)
Definition componenthandler.cpp:235
int handlerCount
Definition componenthandler.h:73
Steinberg::tresult PLUGIN_API beginEdit(Steinberg::Vst::ParamID id) override
Definition componenthandler.cpp:53
int handlerIDCount
Definition componenthandler.h:74
DECLARE_FUNKNOWN_METHODS Steinberg::Vst::PlugInterfaceSupport * getPlugInterfaceSupport() const
Definition componenthandler.h:66
Steinberg::tresult PLUGIN_API restartComponent(Steinberg::int32 flags) override
Definition componenthandler.cpp:153
std::mutex componentHandlerMutex
Definition componenthandler.h:76
int connectHandler(char *event_name, void *callback, void *data)
Definition componenthandler.cpp:188
Steinberg::tresult PLUGIN_API endEdit(Steinberg::Vst::ParamID id) override
Definition componenthandler.cpp:120
ComponentHandler()
Definition componenthandler.cpp:37
AgsVstTResult(* ComponentHandlerBeginEdit)(AgsVstIComponentHandler *icomponent_handler, AgsVstParamID id, gpointer data)
Definition componenthandler.h:35
AgsVstTResult(* ComponentHandlerRestartComponent)(AgsVstIComponentHandler *icomponent_handler, gint32 flags, gpointer data)
Definition componenthandler.h:38
AgsVstTResult(* ComponentHandlerEndEdit)(AgsVstIComponentHandler *icomponent_handler, AgsVstParamID id, gpointer data)
Definition componenthandler.h:37
AgsVstTResult(* ComponentHandlerPerformEdit)(AgsVstIComponentHandler *icomponent_handler, AgsVstParamID id, AgsVstParamValue value_normalized, gpointer data)
Definition componenthandler.h:36
Definition componenthandler.cpp:28
Definition componenthandler.h:41
int handler_id
Definition componenthandler.h:46
void * callback
Definition componenthandler.h:44
char * event_name
Definition componenthandler.h:42
void * data
Definition componenthandler.h:45