From 02c384d11e18266df2754dd55dd73c1e19d7a55f Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Thu, 25 Aug 2016 16:04:44 +1000 Subject: [PATCH] Use XMLNode::set_property in ARDOUR::MidiDiskstream --- libs/ardour/midi_diskstream.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index cfcfc1c8da..3b276d3fb5 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -1227,7 +1227,6 @@ XMLNode& MidiDiskstream::get_state () { XMLNode& node (Diskstream::get_state()); - char buf[64]; LocaleGuard lg; if (_write_source && _session.get_record_enabled()) { @@ -1236,7 +1235,7 @@ MidiDiskstream::get_state () XMLNode* cs_grandchild; 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); /* store the location where capture will start */ @@ -1244,14 +1243,13 @@ MidiDiskstream::get_state () Location* pi; 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)) { - snprintf (buf, sizeof (buf), "%" PRId64, pi->start()); + cs_child->set_property (X_("at"), pi->start()); } 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); }