#include <pbd/error.h>
#include <pbd/stl_delete.h>
#include <pbd/whitespace.h>
+#include <pbd/memento_command.h>
#include <gtkmm/menu.h>
#include <gtkmm/menuitem.h>
#include "gui_thread.h"
#include "keyboard.h"
#include "playlist_selector.h"
-#include "plugin_selector.h"
-#include "plugin_ui.h"
#include "point_selection.h"
#include "prompter.h"
#include "public_editor.h"
}
}
+ XMLNode &before = playlist->get_state();
switch (op) {
case Cut:
- _session.add_undo (playlist->get_memento());
if ((what_we_got = playlist->cut (time)) != 0) {
editor.get_cut_buffer().add (what_we_got);
- _session.add_redo_no_execute (playlist->get_memento());
+ _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
ret = true;
}
break;
break;
case Clear:
- _session.add_undo (playlist->get_memento());
if ((what_we_got = playlist->cut (time)) != 0) {
- _session.add_redo_no_execute (playlist->get_memento());
+ _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
what_we_got->unref ();
ret = true;
}
if (get_diskstream()->speed() != 1.0f)
pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
- _session.add_undo (playlist->get_memento());
+ XMLNode &before = playlist->get_state();
playlist->paste (**p, pos, times);
- _session.add_redo_no_execute (playlist->get_memento());
+ _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
return true;
}