2 Copyright (C) 2008-2012 Paul Davis
3 Author: David Robillard
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.
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.
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.
20 #ifndef __ardour_lv2_plugin_ui_h__
21 #define __ardour_lv2_plugin_ui_h__
24 #include "gtk2ardour-config.h"
31 #include <gtkmm/widget.h>
32 #include <sigc++/signal.h>
34 #include "ardour_dialog.h"
35 #include "ardour/types.h"
36 #include "plugin_ui.h"
40 #include "lv2_external_ui.h"
47 class LV2PluginUI : public PlugUIBase, public Gtk::VBox
50 LV2PluginUI (boost::shared_ptr<ARDOUR::PluginInsert>,
51 boost::shared_ptr<ARDOUR::LV2Plugin>);
54 gint get_preferred_height ();
55 gint get_preferred_width ();
58 bool start_updating(GdkEventAny*);
59 bool stop_updating(GdkEventAny*);
61 int package (Gtk::Window&);
65 void parameter_changed (uint32_t, float);
67 typedef boost::shared_ptr<ARDOUR::AutomationControl> ControllableRef;
69 boost::shared_ptr<ARDOUR::LV2Plugin> _lv2;
70 std::vector<int> _output_ports;
71 sigc::connection _screen_update_connection;
72 Gtk::Widget* _gui_widget;
73 /** a box containing the focus, bypass, delete, save / add preset buttons etc. */
74 Gtk::HBox* _ardour_buttons_box;
76 std::vector<ControllableRef> _controllables;
77 struct lv2_external_ui_host _external_ui_host;
78 LV2_Feature _external_ui_feature;
79 struct lv2_external_ui* _external_ui_ptr;
80 Gtk::Window* _win_ptr;
83 static void on_external_ui_closed(void* controller);
85 static void write_from_ui(void* controller,
91 static void write_to_ui(void* controller,
97 static uint32_t port_index(void* controller, const char* symbol);
99 static void touch(void* controller,
103 void update_timeout();
105 void lv2ui_instantiate(const std::string& title);
108 void parameter_update(uint32_t, float);
109 bool configure_handler (GdkEventConfigure*);
110 void save_plugin_setting ();
111 void output_update();
112 bool is_update_wanted(uint32_t index);
114 virtual bool on_window_show(const std::string& title);
115 virtual void on_window_hide();
118 #endif // LV2_SUPPORT
120 #endif /* __ardour_lv2_plugin_ui_h__ */