do not update LV2 output port displays unless the value has changed
This commit is contained in:
parent
1d4494961b
commit
47bbffc5d8
@ -189,8 +189,14 @@ LV2PluginUI::output_update()
|
|||||||
uint32_t nports = _output_ports.size();
|
uint32_t nports = _output_ports.size();
|
||||||
for (uint32_t i = 0; i < nports; ++i) {
|
for (uint32_t i = 0; i < nports; ++i) {
|
||||||
uint32_t index = _output_ports[i];
|
uint32_t index = _output_ports[i];
|
||||||
float val = _lv2->get_parameter(index);
|
float val = _lv2->get_parameter (index);
|
||||||
|
|
||||||
|
if (val != _values[index]) {
|
||||||
|
/* Send to GUI */
|
||||||
suil_instance_port_event ((SuilInstance*)_inst, index, 4, 0, &val);
|
suil_instance_port_event ((SuilInstance*)_inst, index, 4, 0, &val);
|
||||||
|
/* Cache current value */
|
||||||
|
_values[index] = val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Input ports marked for update because the control value changed
|
/* Input ports marked for update because the control value changed
|
||||||
@ -368,10 +374,16 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
|
|||||||
|
|
||||||
_values = new float[num_ports];
|
_values = new float[num_ports];
|
||||||
_controllables.resize(num_ports);
|
_controllables.resize(num_ports);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < num_ports; ++i) {
|
for (uint32_t i = 0; i < num_ports; ++i) {
|
||||||
bool ok;
|
bool ok;
|
||||||
uint32_t port = _lv2->nth_parameter(i, ok);
|
uint32_t port = _lv2->nth_parameter(i, ok);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
/* Cache initial value of the parameter, regardless of
|
||||||
|
whether it is input or output
|
||||||
|
*/
|
||||||
|
|
||||||
|
_values[port] = _lv2->get_parameter(port);
|
||||||
_controllables[port] = boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (
|
_controllables[port] = boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (
|
||||||
insert->control(Evoral::Parameter(PluginAutomation, 0, port)));
|
insert->control(Evoral::Parameter(PluginAutomation, 0, port)));
|
||||||
|
|
||||||
@ -379,11 +391,12 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
|
|||||||
if (_controllables[port]) {
|
if (_controllables[port]) {
|
||||||
_controllables[port]->Changed.connect (control_connections, invalidator (*this), boost::bind (&LV2PluginUI::control_changed, this, port), gui_context());
|
_controllables[port]->Changed.connect (control_connections, invalidator (*this), boost::bind (&LV2PluginUI::control_changed, this, port), gui_context());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* queue for first update ("push") to GUI */
|
/* queue for first update ("push") to GUI */
|
||||||
_updates.insert (port);
|
_updates.insert (port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (_lv2->has_message_output()) {
|
if (_lv2->has_message_output()) {
|
||||||
_message_update_connection = Timers::super_rapid_connect (
|
_message_update_connection = Timers::super_rapid_connect (
|
||||||
|
Loading…
Reference in New Issue
Block a user