+ /* create command */
+ string obj_T = n->property ("type_name")->value();
+ if (obj_T == typeid (AudioRegion).name() || obj_T == typeid (Region).name()) {
+ if (audio_regions.count(id))
+ return new MementoCommand<AudioRegion>(*audio_regions[id], before, after);
+ } else if (obj_T == typeid (AudioSource).name()) {
+ if (audio_sources.count(id))
+ return new MementoCommand<AudioSource>(*audio_sources[id], before, after);
+ } else if (obj_T == typeid (Location).name()) {
+ return new MementoCommand<Location>(*_locations.get_location_by_id(id), before, after);
+ } else if (obj_T == typeid (Locations).name()) {
+ return new MementoCommand<Locations>(_locations, before, after);
+ } else if (obj_T == typeid (TempoMap).name()) {
+ return new MementoCommand<TempoMap>(*_tempo_map, before, after);
+ } else if (obj_T == typeid (Playlist).name() || obj_T == typeid (AudioPlaylist).name()) {
+ if (Playlist *pl = playlist_by_name(child->property("name")->value()))
+ return new MementoCommand<Playlist>(*pl, before, after);
+ } else if (obj_T == typeid (Route).name() || obj_T == typeid (AudioTrack).name()) {
+ return new MementoCommand<Route>(*route_by_id(id), before, after);
+ } else if (obj_T == typeid (Curve).name() || obj_T == typeid (AutomationList).name()) {
+ if (automation_lists.count(id))
+ return new MementoCommand<AutomationList>(*automation_lists[id], before, after);
+ } else if (registry.count(id)) { // For Editor and AutomationLine which are off-limits here
+ return new MementoCommand<PBD::StatefulThingWithGoingAway>(*registry[id], before, after);
+ }