Fix LV2 compilation.
[ardour.git] / gtk2_ardour / lv2_plugin_ui.h
1 /*
2     Copyright (C) 2008 Paul Davis
3     Author: Dave Robillard
4
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with this program; if not, write to the Free Software
17     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 */
20
21 #ifndef __ardour_lv2_plugin_ui_h__
22 #define __ardour_lv2_plugin_ui_h__
23
24 #include <vector>
25 #include <map>
26 #include <list>
27
28 #include <sigc++/signal.h>
29 #include <gtkmm/widget.h>
30
31 #include <ardour_dialog.h>
32 #include "ardour/types.h"
33 #include "plugin_ui.h"
34
35 #ifdef HAVE_SLV2
36
37 namespace ARDOUR {
38         class PluginInsert;
39         class LV2Plugin;
40 }
41
42 class LV2PluginUI : public PlugUIBase, public Gtk::VBox
43 {
44   public:
45         LV2PluginUI (boost::shared_ptr<ARDOUR::PluginInsert>, boost::shared_ptr<ARDOUR::LV2Plugin>);
46         ~LV2PluginUI ();
47
48         gint get_preferred_height ();
49         gint get_preferred_width ();
50         bool start_updating(GdkEventAny*);
51         bool stop_updating(GdkEventAny*);
52
53         int package (Gtk::Window&);
54
55   private:
56         boost::shared_ptr<ARDOUR::LV2Plugin> _lv2;
57         std::vector<int> _output_ports;
58         sigc::connection _screen_update_connection;
59         
60         Gtk::Widget*   _gui_widget;
61         SLV2UIInstance _inst;
62         float*         _values;
63         
64         static void lv2_ui_write(
65                         LV2UI_Controller controller,
66                         uint32_t         port_index,
67                         uint32_t         buffer_size,
68                         uint32_t         format,
69                         const void*      buffer);
70         
71         void parameter_changed(uint32_t, float);
72         void parameter_update(uint32_t, float);
73         bool configure_handler (GdkEventConfigure*);
74         void save_plugin_setting ();
75         void output_update();
76         bool is_update_wanted(uint32_t index);
77 };
78
79 #endif // HAVE_SLV2
80
81 #endif /* __ardour_lv2_plugin_ui_h__ */
82