2 Copyright (C) 2010 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_vst_plugin_h__
21 #define __ardour_vst_plugin_h__
23 #include "ardour/plugin.h"
26 typedef struct _AEffect AEffect;
28 typedef struct _VSTHandle VSTHandle;
30 typedef struct _VSTState VSTState;
36 /** Parent class for VST plugins of both Windows and Linux varieties */
37 class LIBARDOUR_API VSTPlugin : public Plugin
40 VSTPlugin (AudioEngine &, Session &, VSTHandle *);
41 virtual ~VSTPlugin ();
46 int set_block_size (pframes_t);
47 bool inplace_broken() const { return true; }
48 float default_value (uint32_t port);
49 float get_parameter (uint32_t port) const;
50 uint32_t nth_parameter (uint32_t port, bool& ok) const;
51 void set_parameter (uint32_t port, float val);
52 void set_parameter_automated (uint32_t port, float val);
53 bool load_preset (PresetRecord);
54 int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
55 std::string describe_parameter (Evoral::Parameter);
56 framecnt_t signal_latency() const;
57 std::set<Evoral::Parameter> automatable() const;
59 bool parameter_is_audio (uint32_t) const { return false; }
60 bool parameter_is_control (uint32_t) const { return true; }
61 bool parameter_is_input (uint32_t) const { return true; }
62 bool parameter_is_output (uint32_t) const { return false; }
65 BufferSet&, ChanMapping in, ChanMapping out,
66 pframes_t nframes, framecnt_t offset
69 std::string unique_id () const;
70 const char * label () const;
71 const char * name () const;
72 const char * maker () const;
73 uint32_t parameter_count () const;
74 void print_parameter (uint32_t, char*, uint32_t len) const;
76 bool has_editor () const;
78 AEffect * plugin () const { return _plugin; }
79 VSTState * state () const { return _state; }
80 MidiBuffer * midi_buffer () const { return _midi_out_buf; }
82 int set_state (XMLNode const &, int);
84 int first_user_preset_index () const;
86 void set_insert (PluginInsert* pi, uint32_t num) { _pi = pi; _num = num; }
87 PluginInsert* plugin_insert () const { return _pi; }
88 uint32_t plugin_number () const { return _num; }
91 void set_plugin (AEffect *);
92 gchar* get_chunk (bool) const;
93 int set_chunk (gchar const *, bool);
94 void add_state (XMLNode *) const;
95 bool load_user_preset (PresetRecord);
96 bool load_plugin_preset (PresetRecord);
97 std::string do_save_preset (std::string name);
98 void do_remove_preset (std::string name);
99 XMLTree * presets_tree () const;
100 std::string presets_file () const;
101 void find_presets ();
109 MidiBuffer* _midi_out_buf;