summaryrefslogtreecommitdiff
path: root/gtk2_ardour/audio_time_axis.cc
diff options
context:
space:
mode:
authorHans Fugal <hans@fugal.net>2006-07-26 23:28:54 +0000
committerHans Fugal <hans@fugal.net>2006-07-26 23:28:54 +0000
commit8e301e875aacc4b7d37f6ed552e460511dafb7f2 (patch)
tree702f85ec8edf8a97a4509b6351e52650bd803504 /gtk2_ardour/audio_time_axis.cc
parentb7bffbe7a249356a93d25a41f7c472cc9dd8f27f (diff)
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
Diffstat (limited to 'gtk2_ardour/audio_time_axis.cc')
-rw-r--r--gtk2_ardour/audio_time_axis.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 7fbe7c9fd8..ebc97be77b 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -1739,12 +1739,14 @@ AudioTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
}
}
+ XMLNode &before, &after;
switch (op) {
case Cut:
- _session.add_undo (playlist->get_memento());
+ before = playlist->get_state();
if ((what_we_got = playlist->cut (time)) != 0) {
editor.get_cut_buffer().add (what_we_got);
- _session.add_redo_no_execute (playlist->get_memento());
+ after = playlist->get_state();
+ _session.add_command (MementoCommand<Playlist>(*playlist, before, after));
ret = true;
}
break;
@@ -1755,9 +1757,9 @@ AudioTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
break;
case Clear:
- _session.add_undo (playlist->get_memento());
+ before = playlist->get_state();
if ((what_we_got = playlist->cut (time)) != 0) {
- _session.add_redo_no_execute (playlist->get_memento());
+ _session.add_command(MementoCommand<Playlist>(*playlist, before, after));
what_we_got->unref ();
ret = true;
}