r228@gwythaint (orig r768): fugalh | 2006-08-09 08:14:55 -0600
[ardour.git] / gtk2_ardour / redirect_automation_time_axis.cc
index a53c1a20e48539e01da67878bc09a3da0f6ccd84..e527fd1d5e9123fee2cdc8e2e6389fd6da1b4ce7 100644 (file)
@@ -21,6 +21,7 @@
 #include <ardour/redirect.h>
 #include <ardour/session.h>
 #include <cstdlib>
+#include <pbd/memento_command.h>
 
 #include "redirect_automation_time_axis.h"
 #include "automation_line.h"
@@ -98,9 +99,10 @@ RedirectAutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item,
                lines.front()->view_to_model_y (y);
                
                _session.begin_reversible_command (description);
-               _session.add_undo (alist.get_memento());
+                XMLNode &before = alist.get_state();
                alist.add (when, y);
-               _session.add_redo_no_execute (alist.get_memento());
+                XMLNode &after = alist.get_state();
+                _session.add_command(new MementoCommand<AutomationList>(alist, before, after));
                _session.commit_reversible_command ();
                _session.set_dirty ();
        }