From 8e301e875aacc4b7d37f6ed552e460511dafb7f2 Mon Sep 17 00:00:00 2001 From: Hans Fugal Date: Wed, 26 Jul 2006 23:28:54 +0000 Subject: r199@gandalf: fugalh | 2006-07-26 17:22:38 -0600 Memento(Redo|Undo)Command has a noop for the undo or redo respectively, and we don't need both before and after state. This is primarily useful for drag start/finish callbacks, and really only makes sense where wrapped by (begin|commit)_reversible_command (a composite command). Also a few more "normal" MementoCommands. git-svn-id: svn://localhost/ardour2/branches/undo@695 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/automation_line.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gtk2_ardour/automation_line.cc') diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index f5b23f01ae..bd7ed326d8 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -887,7 +887,7 @@ AutomationLine::start_drag (ControlPoint* cp, float fraction) } trackview.editor.current_session()->begin_reversible_command (str); - trackview.editor.current_session()->add_undo (get_memento()); + trackview.editor.current_session()->add_command (MementoUndoCommand(*this, get_state())); first_drag_fraction = fraction; last_drag_fraction = fraction; @@ -936,7 +936,7 @@ AutomationLine::end_drag (ControlPoint* cp) update_pending = false; - trackview.editor.current_session()->add_redo_no_execute (get_memento()); + trackview.editor.current_session()->add_command (MementoRedoCommand(*this, get_state())); trackview.editor.current_session()->commit_reversible_command (); trackview.editor.current_session()->set_dirty (); } @@ -1226,7 +1226,6 @@ 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_command (MementoCommand(*this, before, get_state())); trackview.editor.current_session()->commit_reversible_command (); -- cgit v1.2.3