diff options
author | nick_m <mainsbridge@gmail.com> | 2015-06-14 05:17:25 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2015-06-17 09:54:22 +1000 |
commit | 7cb9dbb8af5c4bd957067816d304282fa5120844 (patch) | |
tree | 49b44148809bf782f4735417e536a27e41f3c17c /libs/ardour/automation_control.cc | |
parent | 57ce447fd19bd794afe90748d466bbe172c2eab0 (diff) |
Rudimentary automation touch undo/redo.
Diffstat (limited to 'libs/ardour/automation_control.cc')
-rw-r--r-- | libs/ardour/automation_control.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index da33ad12a5..4ece790248 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -19,12 +19,15 @@ */ #include <iostream> - #include "ardour/automation_control.h" #include "ardour/automation_watch.h" #include "ardour/event_type_map.h" #include "ardour/session.h" +#include "pbd/memento_command.h" + +#include "i18n.h" + using namespace std; using namespace ARDOUR; using namespace PBD; @@ -118,6 +121,7 @@ AutomationControl::start_touch(double when) if (alist()->automation_state() == Touch) { /* subtle. aligns the user value with the playback */ set_value (get_value ()); + _before = &alist ()->get_state (); alist()->start_touch (when); if (!_desc.toggled) { AutomationWatch::instance().add_automation_watch (shared_from_this()); @@ -138,6 +142,10 @@ AutomationControl::stop_touch(bool mark, double when) if (!_desc.toggled) { AutomationWatch::instance().remove_automation_watch (shared_from_this()); } + + _session.begin_reversible_command (_("record automation controller")); + _session.add_command (new MementoCommand<AutomationList> (*alist ().get (), _before, &alist ()->get_state ())); + _session.commit_reversible_command (); } } } |