summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_tempodisplay.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-05 01:53:30 +0000
committerDavid Robillard <d@drobilla.net>2009-05-05 01:53:30 +0000
commit83c27fa88879e20cd7ec8a87865dc2d3d91d1a88 (patch)
treea807e1ef077257a0c9b1bb7648c8ba60b8f4a0b0 /gtk2_ardour/editor_tempodisplay.cc
parent90c82a97a7f4e3d8eeb3688eaa8a1aca7ac760c2 (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/editor_tempodisplay.cc')
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc8
1 files changed, 4 insertions, 4 deletions
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 ();
}