diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-14 12:27:37 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-14 12:27:37 +0000 |
commit | 66062a85b6388b28ed04f90bab3d302eec0f2a77 (patch) | |
tree | 89c1ea74a896e60e14143bc6e3dde867eac42c48 /libs/ardour/session_command.cc | |
parent | 5ce47b52da7bb60b5b7dde94ca0bacc6ae44197a (diff) |
Fix binding of automation list undo records to MIDI sources. Should fix the remainder of #3203.
git-svn-id: svn://localhost/ardour2/branches/3.0@7411 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_command.cc')
-rw-r--r-- | libs/ardour/session_command.cc | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc index 17ffa1e26d..dc918dfe1c 100644 --- a/libs/ardour/session_command.cc +++ b/libs/ardour/session_command.cc @@ -33,6 +33,7 @@ #include "ardour/midi_region.h" #include "ardour/session_playlists.h" #include "ardour/region_factory.h" +#include "ardour/midi_automation_list_binder.h" #include "pbd/error.h" #include "pbd/id.h" #include "pbd/statefuldestructible.h" @@ -58,7 +59,12 @@ Session::memento_command_factory(XMLNode *n) XMLNode *child = 0; /* get id */ - id = PBD::ID(n->property("obj-id")->value()); + + /* XXX: HACK! */ + bool have_id = n->property("obj-id") != 0; + if (have_id) { + id = PBD::ID(n->property("obj-id")->value()); + } /* get before/after */ @@ -121,11 +127,20 @@ Session::memento_command_factory(XMLNode *n) } } else if (obj_T == "Evoral::Curve" || obj_T == "ARDOUR::AutomationList") { - std::map<PBD::ID, AutomationList*>::iterator i = automation_lists.find(id); - if (i != automation_lists.end()) { - return new MementoCommand<AutomationList>(*i->second, before, after); - } - cerr << "Alist not found\n"; + 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 not found\n"; + } else if (registry.count(id)) { // For Editor and AutomationLine which are off-limits herea return new MementoCommand<PBD::StatefulDestructible>(*registry[id], before, after); } |