summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/session.h3
-rw-r--r--libs/ardour/session_command.cc27
-rw-r--r--libs/ardour/wscript1
3 files changed, 25 insertions, 6 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index f770b9b459..5255654005 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -1204,8 +1204,11 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
/* SOURCES */
mutable Glib::Mutex source_lock;
+
+ public:
typedef std::map<PBD::ID,boost::shared_ptr<Source> > SourceMap;
+ private:
SourceMap sources;
public:
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);
}
diff --git a/libs/ardour/wscript b/libs/ardour/wscript
index c859a2e88d..95682ce477 100644
--- a/libs/ardour/wscript
+++ b/libs/ardour/wscript
@@ -112,6 +112,7 @@ libardour_sources = [
'location.cc',
'location_importer.cc',
'meter.cc',
+ 'midi_automation_list_binder.cc',
'midi_buffer.cc',
'midi_clock_slave.cc',
'midi_diskstream.cc',