diff options
author | Hans Fugal <hans@fugal.net> | 2006-07-25 01:50:20 +0000 |
---|---|---|
committer | Hans Fugal <hans@fugal.net> | 2006-07-25 01:50:20 +0000 |
commit | b7bffbe7a249356a93d25a41f7c472cc9dd8f27f (patch) | |
tree | f4e2739586f55cca66834c32c63bb7027c46e920 /gtk2_ardour/location_ui.cc | |
parent | 55159005b925396eeb41529f6e5b1d998fe63dc2 (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/location_ui.cc')
-rw-r--r-- | gtk2_ardour/location_ui.cc | 16 |
1 files changed, 10 insertions, 6 deletions
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<Location>(*(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<Locations>(*(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<Locations>(*(session->locations()), before, after)); session->commit_reversible_command (); } } |