diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2016-08-28 10:18:32 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2017-04-19 09:36:51 +1000 |
commit | 8ea1431fc21bf6eedd07291b700ab36d4be78cbf (patch) | |
tree | 0aaaf0ef012edd56adae8250dda4b92e1e7cdf2d /libs/ardour/send.cc | |
parent | 03559d43b9b9fa747ae312a794efc32478aa69ef (diff) |
Use XMLNode::get/set_property in ARDOUR::Send class
Diffstat (limited to 'libs/ardour/send.cc')
-rw-r--r-- | libs/ardour/send.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index d0049ff7b2..13d8056d6d 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -216,16 +216,14 @@ XMLNode& Send::state (bool full) { XMLNode& node = Delivery::state(full); - char buf[32]; - node.add_property ("type", "send"); - snprintf (buf, sizeof (buf), "%" PRIu32, _bitslot); + node.set_property ("type", "send"); if (_role != Listen) { - node.add_property ("bitslot", buf); + node.set_property ("bitslot", _bitslot); } - node.add_property("selfdestruct", _remove_on_disconnect ? "yes" : "no"); + node.set_property ("selfdestruct", _remove_on_disconnect); node.add_child_nocopy (_amp->state (full)); @@ -261,11 +259,11 @@ Send::set_state (const XMLNode& node, int version) } else { if (_role == Delivery::Aux) { _session.unmark_aux_send_id (_bitslot); - sscanf (prop->value().c_str(), "%" PRIu32, &_bitslot); + _bitslot = string_to<uint32_t>(prop->value()); _session.mark_aux_send_id (_bitslot); } else if (_role == Delivery::Send) { _session.unmark_send_id (_bitslot); - sscanf (prop->value().c_str(), "%" PRIu32, &_bitslot); + _bitslot = string_to<uint32_t>(prop->value()); _session.mark_send_id (_bitslot); } else { // bitslot doesn't matter but make it zero anyway @@ -274,9 +272,7 @@ Send::set_state (const XMLNode& node, int version) } } - if ((prop = node.property (X_("selfdestruct"))) != 0) { - _remove_on_disconnect = string_is_affirmative (prop->value()); - } + node.get_property (X_("selfdestruct"), _remove_on_disconnect); XMLNodeList nlist = node.children(); for (XMLNodeIterator i = nlist.begin(); i != nlist.end(); ++i) { |