summaryrefslogtreecommitdiff
path: root/libs/ardour/region.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-05-26 12:24:04 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-05-26 12:24:04 +0000
commitf38db9a4e350de376308d89059ba123a16719f1a (patch)
tree911e0a02baee2cf412ea675d8267e0a449f25603 /libs/ardour/region.cc
parentaf02cbcafa96e7d88f1d06923ac00440be4d049b (diff)
move session file storage of nested sources from playlist into region, and reload them within Session::XMLRegionFactory, just before we create the region that uses the nested source
git-svn-id: svn://localhost/ardour2/branches/3.0@9595 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/region.cc')
-rw-r--r--libs/ardour/region.cc45
1 files changed, 30 insertions, 15 deletions
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 3fbe288b7a..53c36ed5b5 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -37,6 +37,7 @@
#include "ardour/region_factory.h"
#include "ardour/session.h"
#include "ardour/source.h"
+#include "ardour/source_factory.h"
#include "ardour/tempo.h"
#include "ardour/utils.h"
@@ -1206,6 +1207,24 @@ Region::state ()
node->add_property (buf2, buf);
}
+ if (max_source_level() > 0) {
+
+ XMLNode* nested_node = new XMLNode (X_("NestedSource"));
+
+ /* region is compound - get its playlist and
+ store that before we list the region that
+ needs it ...
+ */
+
+ for (SourceList::const_iterator s = _sources.begin(); s != _sources.end(); ++s) {
+ nested_node->add_child_nocopy ((*s)->get_state ());
+ }
+
+ if (nested_node) {
+ node->add_child_nocopy (*nested_node);
+ }
+ }
+
if (_extra_xml) {
node->add_child_copy (*_extra_xml);
}
@@ -1230,6 +1249,17 @@ int
Region::_set_state (const XMLNode& node, int /*version*/, PropertyChange& what_changed, bool send)
{
const XMLProperty* prop;
+ const XMLNodeList& nlist = node.children();
+
+ for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
+
+ XMLNode *child = (*niter);
+
+ if (child->name () == "Extra") {
+ delete _extra_xml;
+ _extra_xml = new XMLNode (*child);
+ }
+ }
what_changed = set_values (node);
@@ -1262,21 +1292,6 @@ Region::_set_state (const XMLNode& node, int /*version*/, PropertyChange& what_c
_shift = 1.0f;
}
- const XMLNodeList& nlist = node.children();
-
- for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
- XMLNode *child;
-
- child = (*niter);
-
- if (child->name () == "Extra") {
- delete _extra_xml;
- _extra_xml = new XMLNode (*child);
- break;
- }
- }
-
if (send) {
send_change (what_changed);
}