summaryrefslogtreecommitdiff
path: root/libs/ardour/return.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2016-08-28 20:47:38 +1000
committerTim Mayberry <mojofunk@gmail.com>2017-04-19 09:36:53 +1000
commite900c67dde7903031d3469d5477396b67e9f1bfe (patch)
tree59bc89a7af40fad4cf032f1ababc23dfd5699f9d /libs/ardour/return.cc
parent20400af96f92c85be9d6ec9d9d470d5e32e069b6 (diff)
Use XMLNode::get/set_property API in ARDOUR::Return class
Diffstat (limited to 'libs/ardour/return.cc')
-rw-r--r--libs/ardour/return.cc16
1 files 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();
}
}