summaryrefslogtreecommitdiff
path: root/libs/ardour/automation_control.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/automation_control.cc')
-rw-r--r--libs/ardour/automation_control.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc
index 671cd6e977..1f507b7015 100644
--- a/libs/ardour/automation_control.cc
+++ b/libs/ardour/automation_control.cc
@@ -163,11 +163,15 @@ AutomationControl::stop_touch(bool mark, double when)
}
void
-AutomationControl::commit_transaction ()
+AutomationControl::commit_transaction (bool did_write)
{
- if (alist ()->before ()) {
- _session.begin_reversible_command (string_compose (_("record %1 automation"), name ()));
- _session.commit_reversible_command (new MementoCommand<AutomationList> (*alist ().get (), alist ()->before (), &alist ()->get_state ()));
+ if (did_write) {
+ if (alist ()->before ()) {
+ _session.begin_reversible_command (string_compose (_("record %1 automation"), name ()));
+ _session.commit_reversible_command (new MementoCommand<AutomationList> (*alist ().get (), alist ()->before (), &alist ()->get_state ()));
+ }
+ } else {
+ alist ()->clear_history ();
}
}