summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_line.cc
diff options
context:
space:
mode:
authorHans Fugal <hans@fugal.net>2006-07-25 01:50:20 +0000
committerHans Fugal <hans@fugal.net>2006-07-25 01:50:20 +0000
commitb7bffbe7a249356a93d25a41f7c472cc9dd8f27f (patch)
treef4e2739586f55cca66834c32c63bb7027c46e920 /gtk2_ardour/automation_line.cc
parent55159005b925396eeb41529f6e5b1d998fe63dc2 (diff)
r191@gandalf: fugalh | 2006-07-24 19:50:10 -0600
All the obvious MementoCommand grunt work. Now there's some add_undo/add_redo_no_execute sprinkled around where one is separated from the other (e.g. in different callbacks) or perhaps even where there's only an undo and no redo. Also some sigc-based undo/redo pairs that probably need their own Command class. git-svn-id: svn://localhost/ardour2/branches/undo@692 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r--gtk2_ardour/automation_line.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index b87a71ca87..f5b23f01ae 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -1013,11 +1013,11 @@ AutomationLine::remove_point (ControlPoint& cp)
model_representation (cp, mr);
trackview.editor.current_session()->begin_reversible_command (_("remove control point"));
- trackview.editor.current_session()->add_undo (get_memento());
+ XMLNode &before = get_state();
alist.erase (mr.start, mr.end);
- trackview.editor.current_session()->add_redo_no_execute (get_memento());
+ trackview.editor.current_session()->add_command(MementoCommand<AutomationLine>(*this, before, get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}
@@ -1225,9 +1225,10 @@ void
AutomationLine::clear ()
{
/* parent must create command */
+ XMLNode &before = get_state();
trackview.editor.current_session()->add_undo (get_memento());
alist.clear();
- trackview.editor.current_session()->add_redo_no_execute (get_memento());
+ trackview.editor.current_session()->add_command (MementoCommand<AutomationLine>(*this, before, get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}