add a C++ lifetime MementoCommand API
authorRobin Gareus <robin@gareus.org>
Sun, 10 Apr 2016 15:13:00 +0000 (17:13 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 10 Apr 2016 15:13:00 +0000 (17:13 +0200)
libs/ardour/ardour/automation_list.h
libs/ardour/automation_list.cc

index 37a30acd0305c28b9600a17525447441e6b4cd2e..f317820b7f6adb15977087cdd1ffff8aa9166acc 100644 (file)
@@ -111,6 +111,8 @@ class LIBARDOUR_API AutomationList : public PBD::StatefulDestructible, public Ev
        XMLNode& state (bool full);
        XMLNode& serialize_events ();
 
+       Command* memento_command (XMLNode* before, XMLNode* after);
+
        bool operator!= (const AutomationList &) const;
 
        XMLNode* before () { return _before; }
index bc8ca8e6425863beb45d6cf6289a7d6047e1f736..636a1bbede60a42b3b8004b3a08a9a989541c734 100644 (file)
@@ -27,6 +27,7 @@
 #include "ardour/event_type_map.h"
 #include "ardour/parameter_descriptor.h"
 #include "evoral/Curve.hpp"
+#include "pbd/memento_command.h"
 #include "pbd/stacktrace.h"
 #include "pbd/enumwriter.h"
 
@@ -278,6 +279,12 @@ AutomationList::thaw ()
        }
 }
 
+Command*
+AutomationList::memento_command (XMLNode* before, XMLNode* after)
+{
+       return new MementoCommand<AutomationList> (*this, before, after);
+}
+
 XMLNode&
 AutomationList::get_state ()
 {