diff options
author | Carl Hetherington <carl@carlh.net> | 2011-03-04 23:14:16 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-03-04 23:14:16 +0000 |
commit | fb2ef7cb9a6d903181da3b1d4681dc3faa778d1a (patch) | |
tree | 5c9835f4d49bb51b51def036cbc5bbf187a91b4b /gtk2_ardour/lv2_plugin_ui.cc | |
parent | b20a139129eda1b963798340d067bec849eb8f6e (diff) |
Call PluginControl when a LV2 GUI control changes, rather than calling the plugin directly. Fixes problems with ganged mono plugins on multi-channel tracks.
git-svn-id: svn://localhost/ardour2/branches/3.0@9076 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/lv2_plugin_ui.cc')
-rw-r--r-- | gtk2_ardour/lv2_plugin_ui.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc index f8924e5bec..3f6fa5814c 100644 --- a/gtk2_ardour/lv2_plugin_ui.cc +++ b/gtk2_ardour/lv2_plugin_ui.cc @@ -38,11 +38,8 @@ LV2PluginUI::lv2_ui_write( const void* buffer) { //cout << "lv2_ui_write" << endl; - LV2PluginUI* me = (LV2PluginUI*)controller; - if (*(float*)buffer != me->_values[port_index]) { - //cout << "set_parameter " << port_index << ":" << *(float*)buffer << endl; - me->_lv2->set_parameter(port_index, *(float*)buffer); - } + LV2PluginUI* me = (LV2PluginUI *) controller; + me->_controllables[port_index]->set_value (*(float *) buffer); } void LV2PluginUI::on_external_ui_closed(LV2UI_Controller controller) @@ -190,11 +187,16 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title) } _values = new float[num_ports]; + _controllables.resize (num_ports); for (uint32_t i = 0; i < num_ports; ++i) { bool ok; uint32_t port = _lv2->nth_parameter(i, ok); if (ok) { _values[port] = _lv2->get_parameter(port); + _controllables[port] = boost::dynamic_pointer_cast<ARDOUR::AutomationControl> ( + insert->control (Evoral::Parameter (PluginAutomation, 0, port)) + ); + if (_lv2->parameter_is_control(port) && _lv2->parameter_is_input(port)) { parameter_update(port, _values[port]); } |