major changes to Region, AudioRegion, Playlist, AudioPlaylist and Crossfade state...
[ardour.git] / gtk2_ardour / pan_automation_time_axis.cc
index 34426c127f106833795e8406201a2d73a1510fc3..c484673c996136957f03a88fc35c0d9a3bf288a6 100644 (file)
@@ -23,6 +23,7 @@
 #include <ardour/panner.h>
 
 #include <gtkmm2ext/popup.h>
+#include <pbd/memento_command.h>
 
 #include "pan_automation_time_axis.h"
 #include "automation_line.h"
@@ -51,7 +52,7 @@ PanAutomationTimeAxisView::~PanAutomationTimeAxisView ()
 }
 
 void
-PanAutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEvent* event, jack_nframes_t when, double y)
+PanAutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEvent* event, nframes_t when, double y)
 {
        if (lines.empty()) {
                /* no data, possibly caused by no outputs/inputs */
@@ -88,9 +89,10 @@ PanAutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEv
        AutomationList& alist (lines[line_index]->the_list());
 
        _session.begin_reversible_command (_("add pan automation event"));
-       _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 ();
 }
@@ -106,7 +108,7 @@ void
 PanAutomationTimeAxisView::add_line (AutomationLine& line)
 {
        char buf[32];
-       snprintf(buf,32,"Line %u",lines.size()+1);
+       snprintf(buf,32,"Line %zu",lines.size()+1);
        multiline_selector.append_text(buf);
 
        if (lines.empty()) {