confirm LV2 GUI changes
authorRobin Gareus <robin@gareus.org>
Tue, 20 Oct 2015 23:57:16 +0000 (01:57 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 20 Oct 2015 23:57:16 +0000 (01:57 +0200)
If a parameter change is initiated by the UI, the host sends a
notifications to confirm (echo) or invalidates (replaces) the value.
(automation: touch, playback,...).

Stateless LV2 GUIs without internal data-model depend on this.

gtk2_ardour/lv2_plugin_ui.cc

index 9634a05d0a6da72d41fc3a03bdb786e29f4051ad..ec9a510f9e2b99ec9e75b8e7ed337170c1853bae 100644 (file)
@@ -55,9 +55,9 @@ LV2PluginUI::write_from_ui(void*       controller,
                }
 
                boost::shared_ptr<AutomationControl> ac = me->_controllables[port_index];
-               /* Cache our local copy of the last value received from the GUI */
-               me->_values[port_index] = *(const float*) buffer;
-               /* Now update the control itself */
+
+               me->_updates.insert (port_index);
+
                if (ac) {
                        ac->set_value(*(const float*)buffer);
                }
@@ -207,6 +207,7 @@ LV2PluginUI::output_update()
                float val = _lv2->get_parameter (*i);
                /* push current value to the GUI */
                suil_instance_port_event ((SuilInstance*)_inst, (*i), 4, 0, &val);
+               _values[(*i)] = val;
        }
 
        _updates.clear ();