From 12b9571b8007238a365324238e42721ab994853f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 9 Feb 2010 22:28:46 +0000 Subject: Save and not-yet-working restore of StatefulDiffCommands. git-svn-id: svn://localhost/ardour2/branches/3.0@6669 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_command.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libs/ardour/session_command.cc') 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; +} -- cgit v1.2.3