#include <vector>
#include <pbd/stl_delete.h>
+#include <pbd/memento_command.h>
#include <ardour/automation_event.h>
#include <ardour/curve.h>
using namespace std;
using namespace sigc;
using namespace ARDOUR;
+using namespace PBD;
using namespace Editing;
using namespace Gnome; // for Canvas
}
trackview.editor.current_session()->begin_reversible_command (str);
- trackview.editor.current_session()->add_undo (get_memento());
+ trackview.editor.current_session()->add_command (new MementoUndoCommand<AutomationLine>(*this, get_state()));
first_drag_fraction = fraction;
last_drag_fraction = fraction;
update_pending = false;
- trackview.editor.current_session()->add_redo_no_execute (get_memento());
+ trackview.editor.current_session()->add_command (new MementoRedoCommand<AutomationLine>(*this, get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}
model_representation (cp, mr);
trackview.editor.current_session()->begin_reversible_command (_("remove control point"));
- trackview.editor.current_session()->add_undo (get_memento());
+ XMLNode &before = get_state();
alist.erase (mr.start, mr.end);
- trackview.editor.current_session()->add_redo_no_execute (get_memento());
+ trackview.editor.current_session()->add_command(new MementoCommand<AutomationLine>(*this, before, get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}
AutomationLine::clear ()
{
/* parent must create command */
- trackview.editor.current_session()->add_undo (get_memento());
+ XMLNode &before = get_state();
alist.clear();
- trackview.editor.current_session()->add_redo_no_execute (get_memento());
+ trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, before, get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}
}
}
}
+
+XMLNode &AutomationLine::get_state(void)
+{
+ // TODO
+ return alist.get_state();
+}
+
+int AutomationLine::set_state(const XMLNode &node)
+{
+ // TODO
+ alist.set_state(node);
+}