diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2016-08-28 10:23:13 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2017-04-19 09:36:51 +1000 |
commit | 499e7907337da36d6d0440c22a2f63e3ada7c439 (patch) | |
tree | aaef83aed2a2ff9c819f53122bb279fbd69e235e | |
parent | 8ea1431fc21bf6eedd07291b700ab36d4be78cbf (diff) |
Use XMLNode::get/set_property API in ARDOUR::SoloControl class
-rw-r--r-- | libs/ardour/solo_control.cc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/libs/ardour/solo_control.cc b/libs/ardour/solo_control.cc index fae2ce2623..0b07f88c6b 100644 --- a/libs/ardour/solo_control.cc +++ b/libs/ardour/solo_control.cc @@ -227,20 +227,20 @@ SoloControl::set_state (XMLNode const & node, int version) return -1; } - XMLProperty const * prop; - - if ((prop = node.property ("self-solo")) != 0) { - set_self_solo (string_is_affirmative (prop->value())); + bool yn; + if (node.get_property ("self-solo", yn)) { + set_self_solo (yn); } - if ((prop = node.property ("soloed-by-upstream")) != 0) { + uint32_t val; + if (node.get_property ("soloed-by-upstream", val)) { _soloed_by_others_upstream = 0; // needed for mod_.... () to work - mod_solo_by_others_upstream (atoi (prop->value())); + mod_solo_by_others_upstream (val); } - if ((prop = node.property ("soloed-by-downstream")) != 0) { + if (node.get_property ("soloed-by-downstream", val)) { _soloed_by_others_downstream = 0; // needed for mod_.... () to work - mod_solo_by_others_downstream (atoi (prop->value())); + mod_solo_by_others_downstream (val); } return 0; @@ -251,12 +251,9 @@ SoloControl::get_state () { XMLNode& node (SlavableAutomationControl::get_state()); - node.add_property (X_("self-solo"), _self_solo ? X_("yes") : X_("no")); - char buf[32]; - snprintf (buf, sizeof(buf), "%d", _soloed_by_others_upstream); - node.add_property (X_("soloed-by-upstream"), buf); - snprintf (buf, sizeof(buf), "%d", _soloed_by_others_downstream); - node.add_property (X_("soloed-by-downstream"), buf); + node.set_property (X_("self-solo"), _self_solo); + node.set_property (X_("soloed-by-upstream"), _soloed_by_others_upstream); + node.set_property (X_("soloed-by-downstream"), _soloed_by_others_downstream); return node; } |