summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_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/automation_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/automation_time_axis.cc')
-rw-r--r--gtk2_ardour/automation_time_axis.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index f4b9aaaf7b..4680e3a35f 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -500,13 +500,14 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
AutomationList& alist (line.the_list());
bool ret = false;
- _session.add_undo (alist.get_memento());
+ XMLNode &before, &after;
+ before = alist.get_state();
switch (op) {
case Cut:
if ((what_we_got = alist.cut (selection.time.front().start, selection.time.front().end)) != 0) {
editor.get_cut_buffer().add (what_we_got);
- _session.add_redo_no_execute (alist.get_memento());
+ _session.add_command(MementoCommand<AutomationList>(alist, before, alist.get_state()));
ret = true;
}
break;
@@ -518,7 +519,7 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
case Clear:
if ((what_we_got = alist.cut (selection.time.front().start, selection.time.front().end)) != 0) {
- _session.add_redo_no_execute (alist.get_memento());
+ _session.add_command(MementoCommand<AutomationList>(alist, before, alist.get_state()));
delete what_we_got;
what_we_got = 0;
ret = true;
@@ -580,8 +581,9 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS
AutomationList* what_we_got = 0;
AutomationList& alist (line.the_list());
bool ret = false;
+ XMLNode &before, &after;
- _session.add_undo (alist.get_memento());
+ before = alist.get_state();
for (PointSelection::iterator i = selection.begin(); i != selection.end(); ++i) {
@@ -593,7 +595,7 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS
case Cut:
if ((what_we_got = alist.cut ((*i).start, (*i).end)) != 0) {
editor.get_cut_buffer().add (what_we_got);
- _session.add_redo_no_execute (alist.get_memento());
+ _session.add_command (MementoCommand<AutomationList>(alist, before, alist.get_state()));
ret = true;
}
break;
@@ -605,7 +607,7 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS
case Clear:
if ((what_we_got = alist.cut ((*i).start, (*i).end)) != 0) {
- _session.add_redo_no_execute (alist.get_memento());
+ _session.add_command (MementoCommand<AutomationList>(alist, before, alist.get_state()));
delete what_we_got;
what_we_got = 0;
ret = true;