1 /* GSequencer - Advanced GTK Sequencer
2  * Copyright (C) 2005-2019 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 #include <ags/vst3-capi/pluginterfaces/base/ags_vst_iplugin_base.h>
21 
22 #include <pluginterfaces/base/ipluginbase.h>
23 
24 using namespace Steinberg;
25 
26 extern "C" {
27 
28   const AgsVstTUID*
ags_vst_iplugin_base_get_iid()29   ags_vst_iplugin_base_get_iid()
30   {
31     return((AgsVstTUID *) &(Steinberg::IPluginBase::iid));
32   }
33 
ags_vst_iplugin_base_initialize(AgsVstIPluginBase * iplugin_base,AgsVstFUnknown * funknown)34   AgsVstTResult ags_vst_iplugin_base_initialize(AgsVstIPluginBase *iplugin_base, AgsVstFUnknown *funknown)
35   {
36     return(((Steinberg::IPluginBase *) iplugin_base)->initialize((Steinberg::FUnknown *) funknown));
37   }
38 
ags_vst_iplugin_base_terminate(AgsVstIPluginBase * iplugin_base)39   AgsVstTResult ags_vst_iplugin_base_terminate(AgsVstIPluginBase *iplugin_base)
40   {
41     return(((Steinberg::IPluginBase *) iplugin_base)->terminate());
42   }
43 
ags_vst_pclass_info_alloc()44   AgsVstPClassInfo* ags_vst_pclass_info_alloc()
45   {
46     Steinberg::PClassInfo *info;
47 
48     info = new Steinberg::PClassInfo();
49 
50     return((AgsVstPClassInfo *) info);
51   }
52 
ags_vst_pclass_info_free(AgsVstPClassInfo * info)53   void ags_vst_pclass_info_free(AgsVstPClassInfo *info)
54   {
55     delete info;
56   }
57 
ags_vst_pclass_info_get_cid(AgsVstPClassInfo * info)58   AgsVstTUID* ags_vst_pclass_info_get_cid(AgsVstPClassInfo *info)
59   {
60     return((AgsVstTUID *) &(((Steinberg::PClassInfo *) info)->cid));
61   }
62 
ags_vst_pclass_info_get_cardinality(AgsVstPClassInfo * info)63   gint32 ags_vst_pclass_info_get_cardinality(AgsVstPClassInfo *info)
64   {
65     return(((Steinberg::PClassInfo *) info)->cardinality);
66   }
67 
ags_vst_pclass_info_get_category(AgsVstPClassInfo * info)68   gchar* ags_vst_pclass_info_get_category(AgsVstPClassInfo *info)
69   {
70     return(((Steinberg::PClassInfo *) info)->category);
71   }
72 
ags_vst_pclass_info_get_name(AgsVstPClassInfo * info)73   gchar* ags_vst_pclass_info_get_name(AgsVstPClassInfo *info)
74   {
75     return(((Steinberg::PClassInfo *) info)->name);
76   }
77 
78   const AgsVstTUID*
ags_vst_iplugin_factory_get_iid()79   ags_vst_iplugin_factory_get_iid()
80   {
81     return((AgsVstTUID *) &(Steinberg::IPluginFactory::iid));
82   }
83 
ags_vst_iplugin_factory_get_factory_info(AgsVstIPluginFactory * iplugin_factory,AgsVstPFactoryInfo * pfactory_info)84   AgsVstTResult ags_vst_iplugin_factory_get_factory_info(AgsVstIPluginFactory *iplugin_factory,
85 							 AgsVstPFactoryInfo *pfactory_info)
86   {
87     return(((Steinberg::IPluginFactory *) iplugin_factory)->getFactoryInfo((Steinberg::PFactoryInfo *) pfactory_info));
88   }
89 
ags_vst_iplugin_factory_count_classes(AgsVstIPluginFactory * iplugin_factory)90   gint32 ags_vst_iplugin_factory_count_classes(AgsVstIPluginFactory *iplugin_factory)
91   {
92     return(((Steinberg::IPluginFactory *) iplugin_factory)->countClasses());
93   }
94 
ags_vst_iplugin_factory_get_class_info(AgsVstIPluginFactory * iplugin_factory,gint32 index,AgsVstPClassInfo * info)95   AgsVstTResult ags_vst_iplugin_factory_get_class_info(AgsVstIPluginFactory *iplugin_factory,
96 						       gint32 index, AgsVstPClassInfo *info)
97   {
98     return(((Steinberg::IPluginFactory *) iplugin_factory)->getClassInfo(index, (Steinberg::PClassInfo *) info));
99   }
100 
ags_vst_iplugin_factory_create_instance(AgsVstIPluginFactory * iplugin_factory,AgsVstFIDString * cid,AgsVstFIDString * _iid,void ** obj)101   AgsVstTResult ags_vst_iplugin_factory_create_instance(AgsVstIPluginFactory *iplugin_factory,
102 							AgsVstFIDString *cid, AgsVstFIDString *_iid, void **obj)
103   {
104     return(((Steinberg::IPluginFactory *) iplugin_factory)->createInstance((Steinberg::FIDString) cid, (Steinberg::FIDString) _iid, obj));
105   }
106 
ags_vst_iplugin_factory2_get_iid()107   const AgsVstTUID* ags_vst_iplugin_factory2_get_iid()
108   {
109     return((AgsVstTUID *) &(Steinberg::IPluginFactory2::iid));
110   }
111 
ags_vst_iplugin_factory2_get_class_info2(AgsVstIPluginFactory2 * iplugin_factory2,gint32 index,AgsVstPClassInfo * info)112   AgsVstTResult ags_vst_iplugin_factory2_get_class_info2(AgsVstIPluginFactory2 *iplugin_factory2,
113 							 gint32 index, AgsVstPClassInfo *info)
114   {
115     return(((Steinberg::IPluginFactory2 *) iplugin_factory2)->getClassInfo(index, (Steinberg::PClassInfo *) info));
116   }
117 
ags_vst_iplugin_factory3_get_iid()118   const AgsVstTUID* ags_vst_iplugin_factory3_get_iid()
119   {
120     return((AgsVstTUID *) &(Steinberg::IPluginFactory3::iid));
121   }
122 
ags_vst_iplugin_factory3_get_class_info_unicode(AgsVstIPluginFactory3 * iplugin_factory3,gint32 index,AgsVstPClassInfoW * info)123   AgsVstTResult ags_vst_iplugin_factory3_get_class_info_unicode(AgsVstIPluginFactory3 *iplugin_factory3,
124 								gint32 index, AgsVstPClassInfoW *info)
125   {
126     return(((Steinberg::IPluginFactory3 *) iplugin_factory3)->getClassInfoUnicode(index, (Steinberg::PClassInfoW *) info));
127   }
128 
129 }
130