54 Session::memento_command_factory(
XMLNode *n)
57 XMLNode *before = 0, *after = 0;
63 bool have_id = n->
property(
"obj-id") != 0;
70 if (n->
name() ==
"MementoCommand") {
74 }
else if (n->
name() ==
"MementoUndoCommand") {
77 }
else if (n->
name() ==
"MementoRedoCommand") {
80 }
else if (n->
name() ==
"PlaylistCommand") {
94 if (obj_T ==
"ARDOUR::AudioRegion" || obj_T ==
"ARDOUR::MidiRegion" || obj_T ==
"ARDOUR::Region") {
100 }
else if (obj_T ==
"ARDOUR::AudioSource" || obj_T ==
"ARDOUR::MidiSource") {
101 if (sources.count(
id))
104 }
else if (obj_T ==
"ARDOUR::Location") {
105 Location* loc = _locations->get_location_by_id(
id);
110 }
else if (obj_T ==
"ARDOUR::Locations") {
113 }
else if (obj_T ==
"ARDOUR::TempoMap") {
116 }
else if (obj_T ==
"ARDOUR::Playlist" || obj_T ==
"ARDOUR::AudioPlaylist" || obj_T ==
"ARDOUR::MidiPlaylist") {
121 }
else if (obj_T ==
"ARDOUR::Route" || obj_T ==
"ARDOUR::AudioTrack" || obj_T ==
"ARDOUR::MidiTrack") {
128 }
else if (obj_T ==
"Evoral::Curve" || obj_T ==
"ARDOUR::AutomationList") {
130 std::map<PBD::ID, AutomationList*>::iterator i = automation_lists.find(
id);
131 if (i != automation_lists.end()) {
141 std::cerr <<
"Alist " <<
id <<
" not found\n";
143 }
else if (registry.count(
id)) {
148 error <<
string_compose (
_(
"could not reconstitute MementoCommand from XMLNode. object type = %1 id = %2"), obj_T,
id.to_s()) <<
endmsg;
154 Session::stateful_diff_command_factory (
XMLNode* n)
158 std::string
const obj_T = n->
property (
"type-name")->
value ();
159 if ((obj_T ==
"ARDOUR::AudioRegion" || obj_T ==
"ARDOUR::MidiRegion")) {
165 }
else if (obj_T ==
"ARDOUR::AudioPlaylist" || obj_T ==
"ARDOUR::MidiPlaylist") {
170 std::cerr <<
"Playlist with ID = " <<
id <<
" not found\n";
177 _(
"could not reconstitute StatefulDiffCommand from XMLNode. object type = %1 id = %2"), obj_T,
id.to_s())
const std::string & value() const
const std::string & name() const
LIBPBD_API Transmitter error
const XMLNodeList & children(const std::string &str=std::string()) const
std::ostream & endmsg(std::ostream &ostr)
class LIBPBD_API StatefulDiffCommand
XMLProperty * property(const char *)
const PBD::ID & id() const
std::string string_compose(const std::string &fmt, const T1 &o1)