+void
+AutomationControl::set_automation_state (AutoState as)
+{
+ if (as != alist()->automation_state()) {
+
+ 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());
+ }
+ }
+}
+
+void
+AutomationControl::set_automation_style (AutoStyle as)
+{
+ alist()->set_automation_style (as);
+}
+
+void
+AutomationControl::start_touch(double when)
+{
+ set_touching (true);
+ AutomationWatch::instance().add_automation_watch (shared_from_this());
+ alist()->start_touch(when);
+}
+
+void
+AutomationControl::stop_touch(bool mark, double when)
+{
+ set_touching (false);
+ AutomationWatch::instance().remove_automation_watch (shared_from_this());
+ alist()->stop_touch (mark, when);
+}