summaryrefslogtreecommitdiff
path: root/libs/ardour/track.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-10-24 22:54:25 +0000
committerCarl Hetherington <carl@carlh.net>2011-10-24 22:54:25 +0000
commit60978b5bc49906abae490383a609f907c85a36fa (patch)
treee89fa79e4f61ce0f0ccf88e391fab102b30b9c29 /libs/ardour/track.cc
parent24056f055f0b565595e253e3fb14ea63d5fa91b1 (diff)
Move some code up from {Midi,Audio}Track to Track.
git-svn-id: svn://localhost/ardour2/branches/3.0@10303 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/track.cc')
-rw-r--r--libs/ardour/track.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc
index 493dac73f9..549a54e010 100644
--- a/libs/ardour/track.cc
+++ b/libs/ardour/track.cc
@@ -76,6 +76,8 @@ Track::state (bool full)
{
XMLNode& root (Route::state (full));
root.add_property (X_("monitoring"), enum_2_string (_monitoring));
+ root.add_child_nocopy (_rec_enable_control->get_state());
+ root.add_child_nocopy (_diskstream->get_state ());
return root;
}
@@ -92,6 +94,32 @@ Track::_set_state (const XMLNode& node, int version)
return -1;
}
+ XMLNode* child;
+
+ if (version >= 3000) {
+ if ((child = find_named_node (node, X_("Diskstream"))) != 0) {
+ boost::shared_ptr<Diskstream> ds = diskstream_factory (*child);
+ ds->do_refill_with_alloc ();
+ set_diskstream (ds);
+ }
+ }
+
+ /* set rec-enable control *AFTER* setting up diskstream, because it may
+ want to operate on the diskstream as it sets its own state
+ */
+
+ XMLNodeList nlist = node.children();
+ for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
+ child = *niter;
+
+ XMLProperty* prop;
+ if (child->name() == Controllable::xml_node_name && (prop = child->property ("name")) != 0) {
+ if (prop->value() == X_("recenable")) {
+ _rec_enable_control->set_state (*child, version);
+ }
+ }
+ }
+
const XMLProperty* prop;
if ((prop = node.property (X_("monitoring"))) != 0) {