diff options
-rw-r--r-- | gtk2_ardour/lv2_plugin_ui.cc | 29 | ||||
-rw-r--r-- | gtk2_ardour/lv2_plugin_ui.h | 6 | ||||
-rw-r--r-- | libs/ardour/wscript | 2 |
3 files changed, 35 insertions, 2 deletions
diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc index dec02a7ebc..96f2a182b7 100644 --- a/gtk2_ardour/lv2_plugin_ui.cc +++ b/gtk2_ardour/lv2_plugin_ui.cc @@ -20,6 +20,7 @@ #include "ardour/lv2_plugin.h" #include "ardour/plugin_manager.h" #include "ardour/processor.h" +#include "ardour/session.h" #include "ardour_ui.h" #include "gui_thread.h" @@ -68,13 +69,32 @@ LV2PluginUI::write_to_ui(void* controller, const void* buffer) { LV2PluginUI* me = (LV2PluginUI*)controller; - if (me->_inst) { suil_instance_port_event((SuilInstance*)me->_inst, port_index, buffer_size, format, buffer); } } +uint32_t +LV2PluginUI::port_index(void* controller, const char* symbol) +{ + return ((LV2PluginUI*)controller)->_lv2->port_index(symbol); +} + +void +LV2PluginUI::touch(void* controller, + uint32_t port_index, + bool grabbed) +{ + LV2PluginUI* me = (LV2PluginUI*)controller; + ControllableRef control = me->_controllables[port_index]; + if (grabbed) { + control->start_touch(control->session().transport_frame()); + } else { + control->stop_touch(false, control->session().transport_frame()); + } +} + void LV2PluginUI::update_timeout() { @@ -196,7 +216,12 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title) } if (!ui_host) { - ui_host = suil_host_new(LV2PluginUI::write_from_ui, NULL, NULL, NULL); + ui_host = suil_host_new(LV2PluginUI::write_from_ui, + LV2PluginUI::port_index, + NULL, NULL); +#ifdef HAVE_NEW_SUIL + suil_host_set_touch_func(ui_host, LV2PluginUI::touch); +#endif } const char* container_type = (is_external_ui) ? NS_UI "external" diff --git a/gtk2_ardour/lv2_plugin_ui.h b/gtk2_ardour/lv2_plugin_ui.h index e90b27cf8f..a989213146 100644 --- a/gtk2_ardour/lv2_plugin_ui.h +++ b/gtk2_ardour/lv2_plugin_ui.h @@ -94,6 +94,12 @@ class LV2PluginUI : public PlugUIBase, public Gtk::VBox uint32_t format, const void* buffer); + static uint32_t port_index(void* controller, const char* symbol); + + static void touch(void* controller, + uint32_t port_index, + bool grabbed); + void update_timeout(); void lv2ui_instantiate(const std::string& title); diff --git a/libs/ardour/wscript b/libs/ardour/wscript index e744b3818a..aec91cb2fd 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -265,6 +265,8 @@ def configure(conf): if conf.is_defined('HAVE_LILV'): autowaf.check_pkg(conf, 'suil-0', uselib_store='SUIL', atleast_version='0.2.0', mandatory=False) + autowaf.check_pkg(conf, 'suil-0', uselib_store='NEW_SUIL', + atleast_version='0.5.0', mandatory=False) # autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', # mandatory=False) |