From e900c67dde7903031d3469d5477396b67e9f1bfe Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sun, 28 Aug 2016 20:47:38 +1000 Subject: [PATCH] Use XMLNode::get/set_property API in ARDOUR::Return class --- libs/ardour/return.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libs/ardour/return.cc b/libs/ardour/return.cc index 5c92b9051c..29c3c01632 100644 --- a/libs/ardour/return.cc +++ b/libs/ardour/return.cc @@ -73,10 +73,8 @@ XMLNode& Return::state(bool full) { XMLNode& node = IOProcessor::state(full); - char buf[32]; - node.add_property ("type", "return"); - snprintf (buf, sizeof (buf), "%" PRIu32, _bitslot); - node.add_property ("bitslot", buf); + node.set_property ("type", "return"); + node.set_property ("bitslot", _bitslot); return node; } @@ -86,7 +84,6 @@ Return::set_state (const XMLNode& node, int version) { XMLNodeList nlist = node.children(); XMLNodeIterator niter; - XMLProperty const * prop; const XMLNode* insert_node = &node; /* Return has regular IO automation (gain, pan) */ @@ -102,12 +99,13 @@ Return::set_state (const XMLNode& node, int version) IOProcessor::set_state (*insert_node, version); if (!node.property ("ignore-bitslot")) { - if ((prop = node.property ("bitslot")) == 0) { - _bitslot = _session.next_return_id(); - } else { + uint32_t bitslot; + if (node.get_property ("bitslot", bitslot)) { _session.unmark_return_id (_bitslot); - sscanf (prop->value().c_str(), "%" PRIu32, &_bitslot); + _bitslot = bitslot; _session.mark_return_id (_bitslot); + } else { + _bitslot = _session.next_return_id(); } }