Remove most using declarations from header files.
[ardour.git] / libs / ardour / ardour / vst_plugin.h
1 /*
2     Copyright (C) 2004 Paul Davis 
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
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __ardour_vst_plugin_h__
21 #define __ardour_vst_plugin_h__
22
23 #include <list>
24 #include <map>
25 #include <set>
26 #include <vector>
27 #include <string>
28 #include <dlfcn.h>
29
30 #include <sigc++/signal.h>
31 #include "pbd/stateful.h" 
32 #include <jack/types.h>
33 #include "ardour/plugin.h"
34
35 struct _FSTHandle;
36 struct _FST;
37 typedef struct _FSTHandle FSTHandle;
38 typedef struct _FST FST;
39 class AEffect;
40
41 namespace ARDOUR {
42 class AudioEngine;
43 class Session;
44
45 class VSTPlugin : public ARDOUR::Plugin
46 {
47   public:
48         VSTPlugin (ARDOUR::AudioEngine&, ARDOUR::Session&, FSTHandle* handle);
49         VSTPlugin (const VSTPlugin &);
50         ~VSTPlugin ();
51
52         /* Plugin interface */
53         
54         std::string unique_id() const;
55         const char * label() const;
56         const char * name() const;
57         const char * maker() const;
58         uint32_t parameter_count() const;
59         float default_value (uint32_t port);
60         nframes_t signal_latency() const;
61         void set_parameter (uint32_t port, float val);
62         float get_parameter (uint32_t port) const;
63         int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
64         std::set<Evoral::Parameter> automatable() const;
65         uint32_t nth_parameter (uint32_t port, bool& ok) const;
66         void activate ();
67         void deactivate ();
68         void set_block_size (nframes_t nframes);
69
70         int connect_and_run (BufferSet&,
71                         ChanMapping in, ChanMapping out,
72                         nframes_t nframes, nframes_t offset);
73
74         std::string describe_parameter (Evoral::Parameter);
75         std::string state_node_name() const { return "vst"; }
76         void print_parameter (uint32_t, char*, uint32_t len) const;
77
78         bool parameter_is_audio(uint32_t i) const { return false; }
79         bool parameter_is_control(uint32_t i) const { return true; }
80         bool parameter_is_input(uint32_t i) const { return true; }
81         bool parameter_is_output(uint32_t i) const { return false; }
82
83         bool load_preset (const std::string preset_label );
84         bool save_preset (std::string name);
85
86         bool has_editor () const;
87
88         XMLNode& get_state();
89         int set_state(const XMLNode& node);
90
91         AEffect* plugin() const { return _plugin; }
92         FST* fst() const { return _fst; }
93
94
95   private:
96         FSTHandle* handle;
97         FST*       _fst;
98         AEffect*   _plugin;
99         bool        been_resumed;
100 };
101
102 class VSTPluginInfo : public PluginInfo
103 {
104   public:
105         VSTPluginInfo () {}
106         ~VSTPluginInfo () {}
107         
108         PluginPtr load (Session& session);
109 };
110
111 typedef boost::shared_ptr<VSTPluginInfo> VSTPluginInfoPtr;
112
113 } // namespace ARDOUR
114
115 #endif /* __ardour_vst_plugin_h__ */