- } else if (obj_T == typeid (Evoral::Curve).name() || obj_T == typeid (AutomationList).name()) {
- std::map<PBD::ID, AutomationList*>::iterator i = automation_lists.find(id);
- if (i != automation_lists.end()) {
- return new MementoCommand<AutomationList>(*i->second, before, after);
- }
+ } else if (obj_T == "Evoral::Curve" || obj_T == "ARDOUR::AutomationList") {
+ if (have_id) {
+ std::map<PBD::ID, AutomationList*>::iterator i = automation_lists.find(id);
+ if (i != automation_lists.end()) {
+ return new MementoCommand<AutomationList>(*i->second, before, after);
+ }
+ } else {
+ return new MementoCommand<AutomationList> (
+ new MidiAutomationListBinder (n, sources),
+ before, after
+ );
+ }
+
+ cerr << "Alist " << id << " not found\n";
+
+ } else if (obj_T == "ARDOUR::Crossfade") {
+ if (have_id) {
+ boost::shared_ptr<Crossfade> c = playlists->find_crossfade (id);
+ if (c) {
+ return new MementoCommand<Crossfade> (*c.get(), before, after);
+ }
+ } else {
+ return new MementoCommand<Crossfade> (
+ new CrossfadeBinder (n, playlists),
+ before, after
+ );
+ }
+