X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Flv2_plugin_ui.cc;h=7f735dfcc54f9dd479480cfa9121567370cddd6d;hb=71003b02353ea090902bdd5623d42da141fa25ad;hp=572cdfb6716888731a220787d7e1530f8f2a8c25;hpb=0880a166c4e7ed5ce72eba42522b963eff2730c0;p=ardour.git diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc index 572cdfb671..7f735dfcc5 100644 --- a/gtk2_ardour/lv2_plugin_ui.cc +++ b/gtk2_ardour/lv2_plugin_ui.cc @@ -31,7 +31,7 @@ #include #include -#include "i18n.h" +#include "pbd/i18n.h" using namespace ARDOUR; using namespace Gtk; @@ -59,7 +59,7 @@ LV2PluginUI::write_from_ui(void* controller, me->_updates.insert (port_index); if (ac) { - ac->set_value(*(const float*)buffer); + ac->set_value(*(const float*)buffer, Controllable::NoGroup); } } else if (format == URIMap::instance().urids.atom_eventTransfer) { @@ -140,11 +140,9 @@ LV2PluginUI::control_changed (uint32_t port_index) bool LV2PluginUI::start_updating(GdkEventAny*) { - if (!_output_ports.empty()) { - _screen_update_connection.disconnect(); - _screen_update_connection = Timers::super_rapid_connect - (sigc::mem_fun(*this, &LV2PluginUI::output_update)); - } + _screen_update_connection.disconnect(); + _screen_update_connection = Timers::super_rapid_connect + (sigc::mem_fun(*this, &LV2PluginUI::output_update)); return false; } @@ -152,11 +150,21 @@ bool LV2PluginUI::stop_updating(GdkEventAny*) { //cout << "stop_updating" << endl; + _screen_update_connection.disconnect(); + return false; +} - if (!_output_ports.empty()) { - _screen_update_connection.disconnect(); +void +LV2PluginUI::queue_port_update() +{ + const uint32_t num_ports = _lv2->num_ports(); + for (uint32_t i = 0; i < num_ports; ++i) { + bool ok; + uint32_t port = _lv2->nth_parameter(i, ok); + if (ok) { + _updates.insert (port); + } } - return false; } void @@ -233,6 +241,9 @@ LV2PluginUI::LV2PluginUI(boost::shared_ptr pi, _ardour_buttons_box.pack_end (add_button, false, false); _ardour_buttons_box.pack_end (_preset_combo, false, false); _ardour_buttons_box.pack_end (_preset_modified, false, false); + _ardour_buttons_box.pack_end (pin_management_button, false, false); + + plugin->PresetLoaded.connect (*this, invalidator (*this), boost::bind (&LV2PluginUI::queue_port_update, this), gui_context ()); } void