From b7bffbe7a249356a93d25a41f7c472cc9dd8f27f Mon Sep 17 00:00:00 2001 From: Hans Fugal Date: Tue, 25 Jul 2006 01:50:20 +0000 Subject: 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 --- gtk2_ardour/location_ui.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'gtk2_ardour/location_ui.cc') diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc index f0fe230b57..08d5a0b3af 100644 --- a/gtk2_ardour/location_ui.cc +++ b/gtk2_ardour/location_ui.cc @@ -654,9 +654,11 @@ gint LocationUI::do_location_remove (ARDOUR::Location *loc) } session->begin_reversible_command (_("remove marker")); - session->add_undo (session->locations()->get_memento()); + XMLNode &before, &after; + before = session->locations()->get_state(); session->locations()->remove (loc); - session->add_redo_no_execute (session->locations()->get_memento()); + after = session->locations()->get_state(); + session->add_command(MementoCommand(*(session->locations()), before, after)); session->commit_reversible_command (); return FALSE; @@ -772,9 +774,10 @@ LocationUI::add_new_location() jack_nframes_t where = session->audible_frame(); Location *location = new Location (where, where, "mark", Location::IsMark); session->begin_reversible_command (_("add marker")); - session->add_undo (session->locations()->get_memento()); + XMLNode &before = session->locations()->get_state(); session->locations()->add (location, true); - session->add_redo_no_execute (session->locations()->get_memento()); + XMLNode &after = session->locations()->get_state(); + session->add_command (MementoCommand(*(session->locations()), before, after)); session->commit_reversible_command (); } @@ -788,9 +791,10 @@ LocationUI::add_new_range() Location *location = new Location (where, where, "unnamed", Location::IsRangeMarker); session->begin_reversible_command (_("add range marker")); - session->add_undo (session->locations()->get_memento()); + XMLNode &before = session->locations()->get_state(); session->locations()->add (location, true); - session->add_redo_no_execute (session->locations()->get_memento()); + XMLNode &after = session->locations()->get_state(); + session->add_command (MementoCommand(*(session->locations()), before, after)); session->commit_reversible_command (); } } -- cgit v1.2.3