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.
20 #ifndef __ardour_lxvst_plugin_h__
21 #define __ardour_lxvst_plugin_h__
30 #include "pbd/stateful.h"
31 #include "ardour/plugin.h"
35 typedef struct _VSTHandle VSTHandle;
36 typedef struct _VSTFX VSTFX;
38 typedef struct _AEffect AEffect;
44 class LXVSTPlugin : public ARDOUR::Plugin
47 LXVSTPlugin (ARDOUR::AudioEngine&, ARDOUR::Session&, VSTHandle *);
48 LXVSTPlugin (const LXVSTPlugin &);
51 /* Plugin interface */
53 std::string unique_id() const;
54 const char * label() const;
55 const char * name() const;
56 const char * maker() const;
57 uint32_t parameter_count() const;
58 float default_value (uint32_t port);
59 framecnt_t signal_latency() const;
60 void set_parameter (uint32_t port, float val);
61 float get_parameter (uint32_t port) const;
62 int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
63 std::set<Evoral::Parameter> automatable() const;
64 uint32_t nth_parameter (uint32_t port, bool& ok) const;
67 int set_block_size (pframes_t);
69 int connect_and_run (BufferSet&,
70 ChanMapping in, ChanMapping out,
71 pframes_t nframes, framecnt_t offset);
73 std::string describe_parameter (Evoral::Parameter);
74 std::string state_node_name() const { return "lxvst"; }
75 void print_parameter (uint32_t, char*, uint32_t len) const;
77 bool parameter_is_audio(uint32_t) const { return false; }
78 bool parameter_is_control(uint32_t) const { return true; }
79 bool parameter_is_input(uint32_t) const { return true; }
80 bool parameter_is_output(uint32_t) const { return false; }
82 bool load_preset (PresetRecord);
83 int first_user_preset_index () const;
85 bool has_editor () const;
87 int set_state (XMLNode const &, int);
89 AEffect * plugin () const { return _plugin; }
90 VSTState * vstfx () const { return _vstfx; }
94 void do_remove_preset (std::string name);
95 std::string do_save_preset (std::string name);
96 gchar* get_chunk (bool) const;
97 int set_chunk (gchar const *, bool);
98 XMLTree * presets_tree () const;
99 std::string presets_file () const;
100 void find_presets ();
101 bool load_user_preset (PresetRecord);
102 bool load_plugin_preset (PresetRecord);
103 void add_state (XMLNode *) const;
111 class LXVSTPluginInfo : public PluginInfo
115 ~LXVSTPluginInfo () {}
117 PluginPtr load (Session& session);
120 typedef boost::shared_ptr<LXVSTPluginInfo> LXVSTPluginInfoPtr;
122 } // namespace ARDOUR
124 #endif /* __ardour_lxvst_plugin_h__ */