diff options
author | David Robillard <d@drobilla.net> | 2009-05-05 01:53:30 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-05 01:53:30 +0000 |
commit | 83c27fa88879e20cd7ec8a87865dc2d3d91d1a88 (patch) | |
tree | a807e1ef077257a0c9b1bb7648c8ba60b8f4a0b0 /gtk2_ardour | |
parent | 90c82a97a7f4e3d8eeb3688eaa8a1aca7ac760c2 (diff) |
Support recursive undo events.
Code can now call begin_reversible_command and commit_reversible_command around a region
of code which itself calls those functions (and so on), areas contained within enclosing
regions will be added as sub-commands of the current command (i.e. it's a stack).
Fixes mantix issue #0002558.
git-svn-id: svn://localhost/ardour2/branches/3.0@5051 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_markers.cc | 14 | ||||
-rw-r--r-- | gtk2_ardour/editor_tempodisplay.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/rhythm_ferret.cc | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 6406f04e54..489b6e8cbc 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -400,13 +400,13 @@ Editor::mouse_add_new_marker (nframes64_t where, bool is_cd, bool is_xrun) if (session) { session->locations()->next_available_name(markername, markerprefix); if (!is_xrun && !choose_new_marker_name(markername)) { - return; + return; } Location *location = new Location (where, where, markername, (Location::Flags) flags); session->begin_reversible_command (_("add marker")); - XMLNode &before = session->locations()->get_state(); + XMLNode &before = session->locations()->get_state(); session->locations()->add (location, true); - XMLNode &after = session->locations()->get_state(); + XMLNode &after = session->locations()->get_state(); session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after)); session->commit_reversible_command (); @@ -1042,7 +1042,7 @@ Editor::marker_menu_rename () loc = find_location_from_marker (marker, is_start); if (!loc) return; - + ArdourPrompter dialog (true); string txt; @@ -1075,12 +1075,12 @@ Editor::marker_menu_rename () } begin_reversible_command ( _("rename marker") ); - XMLNode &before = session->locations()->get_state(); + XMLNode &before = session->locations()->get_state(); dialog.get_result(txt); loc->set_name (txt); - - XMLNode &after = session->locations()->get_state(); + + XMLNode &after = session->locations()->get_state(); session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after)); commit_reversible_command (); } diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 00d0b94a0e..be7203f2db 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -337,7 +337,7 @@ Editor::edit_tempo_section (TempoSection* section) tempo_dialog.set_position (Gtk::WIN_POS_MOUSE); ensure_float (tempo_dialog); - + switch (tempo_dialog.run ()) { case RESPONSE_ACCEPT: break; @@ -350,16 +350,16 @@ Editor::edit_tempo_section (TempoSection* section) BBT_Time when; tempo_dialog.get_bbt_time(when); bpm = max (0.01, bpm); - + cerr << "Editing tempo section to be at " << when << endl; session->tempo_map().dump (cerr); begin_reversible_command (_("replace tempo mark")); - XMLNode &before = session->tempo_map().get_state(); + XMLNode &before = session->tempo_map().get_state(); session->tempo_map().replace_tempo (*section, Tempo (bpm,nt)); session->tempo_map().dump (cerr); session->tempo_map().move_tempo (*section, when); session->tempo_map().dump (cerr); - XMLNode &after = session->tempo_map().get_state(); + XMLNode &after = session->tempo_map().get_state(); session->add_command (new MementoCommand<TempoMap>(session->tempo_map(), &before, &after)); commit_reversible_command (); } diff --git a/gtk2_ardour/rhythm_ferret.cc b/gtk2_ardour/rhythm_ferret.cc index ecad24e181..62f51c8a65 100644 --- a/gtk2_ardour/rhythm_ferret.cc +++ b/gtk2_ardour/rhythm_ferret.cc @@ -406,8 +406,8 @@ RhythmFerret::do_split_action () i = tmp; } + session->commit_reversible_command (); - } void |