2 Copyright (C) 2004 Paul Davis
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.
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.
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.
21 #ifndef __ardour_vst_plugin_h__
22 #define __ardour_vst_plugin_h__
31 #include <midi++/controllable.h>
32 #include <sigc++/signal.h>
34 #include <jack/types.h>
35 #include <ardour/stateful.h>
36 #include <ardour/plugin_state.h>
37 #include <ardour/plugin.h>
46 typedef struct _FSTHandle FSTHandle;
47 typedef struct _FST FST;
54 class VSTPlugin : public ARDOUR::Plugin
57 VSTPlugin (ARDOUR::AudioEngine&, ARDOUR::Session&, FSTHandle* handle);
58 VSTPlugin (const VSTPlugin &);
61 /* Plugin interface */
63 uint32_t unique_id() const;
64 const char * label() const;
65 const char * name() const;
66 const char * maker() const;
67 uint32_t parameter_count() const;
68 float default_value (uint32_t port);
69 jack_nframes_t latency() const;
70 void set_parameter (uint32_t port, float val);
71 float get_parameter (uint32_t port) const;
72 int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
73 std::set<uint32_t> automatable() const;
74 uint32_t nth_parameter (uint32_t port, bool& ok) const;
77 void set_block_size (jack_nframes_t nframes);
78 int connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, jack_nframes_t nframes, jack_nframes_t offset);
79 void store_state (ARDOUR::PluginState&);
80 void restore_state (ARDOUR::PluginState&);
81 string describe_parameter (uint32_t);
82 string state_node_name() const { return "vst"; }
83 void print_parameter (uint32_t, char*, uint32_t len) const;
85 bool parameter_is_audio(uint32_t i) const { return false; }
86 bool parameter_is_control(uint32_t i) const { return true; }
87 bool parameter_is_input(uint32_t i) const { return true; }
88 bool parameter_is_output(uint32_t i) const { return false; }
90 bool load_preset (const string preset_label );
91 bool save_preset(string name);
93 bool has_editor () const;
96 int set_state(const XMLNode& node);
98 AEffect* plugin() const { return _plugin; }
99 FST* fst() const { return _fst; }
111 #endif /* __ardour_vst_plugin_h__ */