summaryrefslogtreecommitdiff
path: root/libs/ardour/automation_control.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2015-11-02 02:12:54 +1100
committernick_m <mainsbridge@gmail.com>2015-11-02 02:12:54 +1100
commit7ade596c92b00eae871e8f2f5b5d6e0d1ebd93d7 (patch)
tree447de9dc0885f72674ce6b56145791fa6820310a /libs/ardour/automation_control.cc
parent2d47196f4305c28fe9c9116b0b890f1c48b99508 (diff)
Clean up _before XMLNode in AutomationList if no automation write occurred.
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 ();
}
}