MIDI metering.
[ardour.git] / gtk2_ardour / pan_automation_time_axis.cc
index 34426c127f106833795e8406201a2d73a1510fc3..c008a10ff08903c554615f8a20e3a1cc02834e5b 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <ardour/curve.h>
@@ -23,6 +22,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 +51,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 +88,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 +107,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()) {