Ardour  9.0-pre0-582-g084a23a80d
vst3_module.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef _ardour_vst3_module_h_
20 #define _ardour_vst3_module_h_
21 
22 #include <memory>
23 #include <string>
24 
26 
27 namespace Steinberg {
28  class IPluginFactory;
29 }
30 
31 namespace ARDOUR {
32 
34 {
35 public:
36  static std::shared_ptr<VST3PluginModule> load (std::string const& path);
37 
38  VST3PluginModule () : _factory (0) {}
39  virtual ~VST3PluginModule () {}
40 
41  Steinberg::IPluginFactory* factory ();
42 
43  bool has_symbol (const char* name) const {
44  return NULL != fn_ptr (name);
45  }
46 
47 protected:
48  void release_factory ();
49 
50  virtual bool init () = 0;
51  virtual bool exit () = 0;
52  virtual void* fn_ptr (const char* name) const = 0;
53 
54 #ifndef NDEBUG
55  std::string _path;
56 #endif
57 
58 private:
59  /* prevent copy construction */
61 
62  Steinberg::IPluginFactory* _factory;
63 };
64 
65 } // namespace ARDOUR
66 #endif
Steinberg::IPluginFactory * _factory
Definition: vst3_module.h:62
virtual void * fn_ptr(const char *name) const =0
Steinberg::IPluginFactory * factory()
virtual bool exit()=0
VST3PluginModule(VST3PluginModule const &)
virtual bool init()=0
bool has_symbol(const char *name) const
Definition: vst3_module.h:43
static std::shared_ptr< VST3PluginModule > load(std::string const &path)
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API