summaryrefslogtreecommitdiff
path: root/libs/ardour/session_command.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-02-09 22:28:46 +0000
committerCarl Hetherington <carl@carlh.net>2010-02-09 22:28:46 +0000
commit12b9571b8007238a365324238e42721ab994853f (patch)
treebfe504849d6d25ce74ea08f1c2bb34465b3c51a4 /libs/ardour/session_command.cc
parentcf9ce8636a95ffcebc1454f842250733edf41de6 (diff)
Save and not-yet-working restore of StatefulDiffCommands.
git-svn-id: svn://localhost/ardour2/branches/3.0@6669 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_command.cc')
-rw-r--r--libs/ardour/session_command.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc
index 19253cc725..897359b274 100644
--- a/libs/ardour/session_command.cc
+++ b/libs/ardour/session_command.cc
@@ -36,6 +36,7 @@
#include "pbd/id.h"
#include "pbd/statefuldestructible.h"
#include "pbd/failed_constructor.h"
+#include "pbd/stateful_diff_command.h"
#include "evoral/Curve.hpp"
using namespace PBD;
@@ -132,3 +133,21 @@ Session::memento_command_factory(XMLNode *n)
return 0 ;
}
+Command *
+Session::stateful_diff_command_factory (XMLNode* n)
+{
+ PBD::ID const id (n->property("obj-id")->value ());
+
+ string const obj_T = n->property ("type-name")->value ();
+ if ((obj_T == typeid (AudioRegion).name() || obj_T == typeid (MidiRegion).name()) && regions.count(id)) {
+ return new StatefulDiffCommand (regions[id].get(), *n);
+ }
+
+ /* we failed */
+
+ error << string_compose (
+ _("could not reconstitute StatefulDiffCommand from XMLNode. object type = %1 id = %2"), obj_T, id.to_s())
+ << endmsg;
+
+ return 0;
+}