diff options
author | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-07-29 02:06:55 +0200 |
---|---|---|
committer | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-07-29 02:06:55 +0200 |
commit | 67cbdc6cf2dd03303a9a257096da7708aad085cb (patch) | |
tree | ff178e6c5b026b4a8991dd9b2299e8fe25c9314b /gtk2_ardour/generic_pluginui.cc | |
parent | 7e30161dc06483fd17ac9e19be1c478ead1b23f6 (diff) |
GenericUI: Update all input controls on preset load
The existing code relies on AutomationControls for getting parameter
changes and update the UI accordingly. One case where this doesn't yet
work is preset loading, where ARDOUR::Plugin is responsible for actually
loading the preset but doesn't notify the changes to AutomationControls.
Since the input_controls vector now contains all ControlUI's that rely on
AutomationControls to get updates, just listen to Plugin::PresetLoaded()
and trigger an update of all elements in input_controls.
This is temporary until a better solution is devised to make
AutomationControls aware of preset loading.
Diffstat (limited to 'gtk2_ardour/generic_pluginui.cc')
-rw-r--r-- | gtk2_ardour/generic_pluginui.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index d8ce68e4b4..0caf475afa 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -315,6 +315,9 @@ GenericPluginUI::build () automation_play_all_button.signal_clicked.connect(sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::set_all_automation), ARDOUR::Play)); automation_write_all_button.signal_clicked.connect(sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::set_all_automation), ARDOUR::Write)); automation_touch_all_button.signal_clicked.connect(sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::set_all_automation), ARDOUR::Touch)); + + /* XXX This is a workaround for AutomationControl not knowing about preset loads */ + plugin->PresetLoaded.connect (*this, invalidator (*this), boost::bind (&GenericPluginUI::update_input_displays, this), gui_context ()); } @@ -847,6 +850,8 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param, automation_state_changed (control_ui); + /* Add to the list of CUIs that need manual update to workaround + * AutomationControl not knowing about preset loads */ input_controls.push_back (control_ui); } else { @@ -1014,6 +1019,18 @@ GenericPluginUI::update_control_display (ControlUI* cui) } void +GenericPluginUI::update_input_displays () +{ + /* XXX This is a workaround for AutomationControl not knowing about preset loads */ + for (vector<ControlUI*>::iterator i = input_controls.begin(); + i != input_controls.end(); + ++i) { + update_control_display(*i); + } + return; +} + +void GenericPluginUI::control_combo_changed (ControlUI* cui, float value) { if (!cui->ignore_change) { |