diff options
Diffstat (limited to 'libs/ardour/session_command.cc')
-rw-r--r-- | libs/ardour/session_command.cc | 19 |
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; +} |