13
0

Use XMLNode::set_property in ARDOUR::MidiDiskstream

This commit is contained in:
Tim Mayberry 2016-08-25 16:04:44 +10:00
parent 66add36402
commit 02c384d11e

View File

@ -1227,7 +1227,6 @@ XMLNode&
MidiDiskstream::get_state () MidiDiskstream::get_state ()
{ {
XMLNode& node (Diskstream::get_state()); XMLNode& node (Diskstream::get_state());
char buf[64];
LocaleGuard lg; LocaleGuard lg;
if (_write_source && _session.get_record_enabled()) { if (_write_source && _session.get_record_enabled()) {
@ -1236,7 +1235,7 @@ MidiDiskstream::get_state ()
XMLNode* cs_grandchild; XMLNode* cs_grandchild;
cs_grandchild = new XMLNode (X_("file")); cs_grandchild = new XMLNode (X_("file"));
cs_grandchild->add_property (X_("path"), _write_source->path()); cs_grandchild->set_property (X_("path"), _write_source->path());
cs_child->add_child_nocopy (*cs_grandchild); cs_child->add_child_nocopy (*cs_grandchild);
/* store the location where capture will start */ /* store the location where capture will start */
@ -1244,14 +1243,13 @@ MidiDiskstream::get_state ()
Location* pi; Location* pi;
if (_session.preroll_record_punch_enabled ()) { if (_session.preroll_record_punch_enabled ()) {
snprintf (buf, sizeof (buf), "%" PRId64, _session.preroll_record_punch_pos ()); cs_child->set_property (X_("at"), _session.preroll_record_punch_pos());
} else if (_session.config.get_punch_in() && ((pi = _session.locations()->auto_punch_location()) != 0)) { } else if (_session.config.get_punch_in() && ((pi = _session.locations()->auto_punch_location()) != 0)) {
snprintf (buf, sizeof (buf), "%" PRId64, pi->start()); cs_child->set_property (X_("at"), pi->start());
} else { } else {
snprintf (buf, sizeof (buf), "%" PRId64, _session.transport_frame()); cs_child->set_property (X_("at"), _session.transport_frame());
} }
cs_child->add_property (X_("at"), buf);
node.add_child_nocopy (*cs_child); node.add_child_nocopy (*cs_child);
} }