+ if (update_value) {
+ /* when un-assigning we apply the master-value permanently */
+ double new_val = old_val * master_ratio;
+
+ if (old_val != new_val) {
+ AutomationControl::set_double (new_val, Controllable::NoGroup);
+ }
+
+ /* ..and update automation */
+ if (_list) {
+ XMLNode* before = &alist ()->get_state ();
+ if (master->automation_playback () && master->list()) {
+ _list->list_merge (*master->list().get(), boost::bind (&SlavableAutomationControl::scale_automation_callback, this, _1, _2));
+ printf ("y-t %s %f\n", name().c_str(), list_ratio);
+ _list->y_transform (boost::bind (&SlavableAutomationControl::scale_automation_callback, this, _1, list_ratio));
+ } else {
+ // do we need to freeze/thaw the list? probably no: iterators & positions don't change
+ _list->y_transform (boost::bind (&SlavableAutomationControl::scale_automation_callback, this, _1, master_ratio));
+ }
+ XMLNode* after = &alist ()->get_state ();
+ if (*before != *after) {
+ _session.begin_reversible_command (string_compose (_("Merge VCA automation into %1"), name ()));
+ _session.commit_reversible_command (alist()->memento_command (before, after));
+ }
+ }