LTC generator: undo pull up/down adjustments
[ardour.git] / libs / ardour / automation_control.cc
index 1fde567e28876bc71f755e398c7064eb64ad6668..83b7db34be9afeb762a213a489f659a94a18a074 100644 (file)
@@ -66,17 +66,15 @@ AutomationControl::set_value (double value)
                 // store the previous value just before this so any
                 // interpolation works right
 
-               bool erase_since_last = _session.transport_rolling();
 
-                _list->add (get_double(), _session.transport_frame()-1, erase_since_last);
+                _list->add (get_double(), _session.transport_frame()-1);
         }
 
-       Control::set_double (value, to_list, _session.transport_frame());
+       Control::set_double (value, _session.transport_frame(), to_list);
 
        Changed(); /* EMIT SIGNAL */
 }
 
-
 void
 AutomationControl::set_list (boost::shared_ptr<Evoral::ControlList> list)
 {
@@ -91,17 +89,24 @@ AutomationControl::set_automation_state (AutoState as)
 
                cerr << name() << " setting automation state to " << enum_2_string (as) << endl;
 
+               alist()->set_automation_state (as);
+
                if (as == Write) {
                        AutomationWatch::instance().add_automation_watch (shared_from_this());
                } else if (as == Touch) {
                        if (!touching()) {
                                AutomationWatch::instance().remove_automation_watch (shared_from_this());
+                       } else {
+                               /* this seems unlikely, but the combination of
+                                * a control surface and the mouse could make
+                                * it possible to put the control into Touch
+                                * mode *while* touching it.
+                                */
+                               AutomationWatch::instance().add_automation_watch (shared_from_this());
                        }
                } else {
                        AutomationWatch::instance().remove_automation_watch (shared_from_this());
                }
-               
-               alist()->set_automation_state (as);
        }
 }