colinf's patch to make the cursor be the dbl vertical arrow when over the track resiz...
[ardour2.git] / gtk2_ardour / lv2_plugin_ui.h
blob9bb1fe60aedf36189311144431c4aea99135e598
1 /*
2 Copyright (C) 2008 Paul Davis
3 Author: Dave 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.
21 #ifndef __ardour_lv2_plugin_ui_h__
22 #define __ardour_lv2_plugin_ui_h__
24 #include <vector>
25 #include <map>
26 #include <list>
28 #include <sigc++/signal.h>
29 #include <gtkmm/widget.h>
31 #include <ardour_dialog.h>
32 #include <ardour/types.h>
33 #include "plugin_ui.h"
35 #ifdef HAVE_LV2
37 #include "lv2_external_ui.h"
39 namespace ARDOUR {
40 class PluginInsert;
41 class LV2Plugin;
44 class LV2PluginUI : public PlugUIBase, public Gtk::VBox
46 public:
47 LV2PluginUI (boost::shared_ptr<ARDOUR::PluginInsert>, boost::shared_ptr<ARDOUR::LV2Plugin>);
48 ~LV2PluginUI ();
50 gint get_preferred_height ();
51 gint get_preferred_width ();
52 bool start_updating(GdkEventAny*);
53 bool stop_updating(GdkEventAny*);
55 int package (Gtk::Window&);
57 private:
58 boost::shared_ptr<ARDOUR::LV2Plugin> _lv2;
59 std::vector<int> _output_ports;
60 sigc::connection _screen_update_connection;
62 Gtk::Widget* _gui_widget;
63 SLV2UIInstance _inst;
64 float* _values;
66 struct lv2_external_ui_host _external_ui_host;
67 LV2_Feature _external_ui_feature;
68 struct lv2_external_ui* _external_ui_ptr;
69 Gtk::Window* _win_ptr;
71 static void on_external_ui_closed(LV2UI_Controller controller);
73 static void lv2_ui_write(
74 LV2UI_Controller controller,
75 uint32_t port_index,
76 uint32_t buffer_size,
77 uint32_t format,
78 const void* buffer);
80 void lv2ui_instantiate(const Glib::ustring& title);
82 void parameter_changed(uint32_t, float);
83 void parameter_update(uint32_t, float);
84 bool configure_handler (GdkEventConfigure*);
85 void save_plugin_setting ();
86 void output_update();
87 bool is_update_wanted(uint32_t index);
89 virtual bool on_window_show(const Glib::ustring& title);
90 virtual void on_window_hide();
92 #endif // HAVE_LV2
94 #endif /* __ardour_lv2_plugin_ui_h__ */