summaryrefslogtreecommitdiff
path: root/libs/ardour/automation_control.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-02-19 12:53:19 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-02-19 23:25:08 -0500
commitafdedbf94815808af6d354a8461a9e919859f662 (patch)
tree4bbdf6aa207c713b566b2008abae20c3fb6b1700 /libs/ardour/automation_control.cc
parentf049d0294c8e48b8d1f1ffa131fe7d687d8aa519 (diff)
do not needlessly keep starting touch/automation watch passes just because a command to start or stop touch was received
Diffstat (limited to 'libs/ardour/automation_control.cc')
-rw-r--r--libs/ardour/automation_control.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc
index 2586a14b58..355b0176ce 100644
--- a/libs/ardour/automation_control.cc
+++ b/libs/ardour/automation_control.cc
@@ -117,15 +117,23 @@ AutomationControl::set_automation_style (AutoStyle as)
void
AutomationControl::start_touch(double when)
{
- set_touching (true);
- alist()->start_touch(when);
- AutomationWatch::instance().add_automation_watch (shared_from_this());
+ if (!touching()) {
+ if (alist()->automation_state() == Touch) {
+ alist()->start_touch (when);
+ AutomationWatch::instance().add_automation_watch (shared_from_this());
+ }
+ set_touching (true);
+ }
}
void
AutomationControl::stop_touch(bool mark, double when)
{
- set_touching (false);
- alist()->stop_touch (mark, when);
- AutomationWatch::instance().remove_automation_watch (shared_from_this());
+ if (touching()) {
+ set_touching (false);
+ if (alist()->automation_state() == Touch) {
+ alist()->stop_touch (mark, when);
+ AutomationWatch::instance().remove_automation_watch (shared_from_this());
+ }
+ }
}