summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2016-08-30 11:05:37 +1000
committerTim Mayberry <mojofunk@gmail.com>2017-04-19 09:36:54 +1000
commit9554dd44451ce716a1c00622aad761bf01ee64cf (patch)
tree124e1f67313a56fb44f46b0a2e319b0c9e188fe9 /libs/surfaces/mackie
parentf82cb87f0c842db145c79fb5404e740f01c44f9a (diff)
Use XMLNode::get/set_property API in mackie surface DeviceProfile class
Diffstat (limited to 'libs/surfaces/mackie')
-rw-r--r--libs/surfaces/mackie/device_profile.cc40
1 files changed, 14 insertions, 26 deletions
diff --git a/libs/surfaces/mackie/device_profile.cc b/libs/surfaces/mackie/device_profile.cc
index ca3f146803..8fcde621a5 100644
--- a/libs/surfaces/mackie/device_profile.cc
+++ b/libs/surfaces/mackie/device_profile.cc
@@ -172,24 +172,12 @@ DeviceProfile::set_state (const XMLNode& node, int /* version */)
b = _button_map.insert (_button_map.end(), std::pair<Button::ID,ButtonActions> (bid, ButtonActions()));
}
- if ((prop = (*i)->property ("plain")) != 0) {
- b->second.plain = prop->value ();
- }
- if ((prop = (*i)->property ("control")) != 0) {
- b->second.control = prop->value ();
- }
- if ((prop = (*i)->property ("shift")) != 0) {
- b->second.shift = prop->value ();
- }
- if ((prop = (*i)->property ("option")) != 0) {
- b->second.option = prop->value ();
- }
- if ((prop = (*i)->property ("cmdalt")) != 0) {
- b->second.cmdalt = prop->value ();
- }
- if ((prop = (*i)->property ("shiftcontrol")) != 0) {
- b->second.shiftcontrol = prop->value ();
- }
+ (*i)->get_property ("plain", b->second.plain);
+ (*i)->get_property ("control", b->second.control);
+ (*i)->get_property ("shift", b->second.shift);
+ (*i)->get_property ("option", b->second.option);
+ (*i)->get_property ("cmdalt", b->second.cmdalt);
+ (*i)->get_property ("shiftcontrol", b->second.shiftcontrol);
}
}
}
@@ -205,7 +193,7 @@ DeviceProfile::get_state () const
XMLNode* node = new XMLNode ("MackieDeviceProfile");
XMLNode* child = new XMLNode ("Name");
- child->add_property ("value", name());
+ child->set_property ("value", name());
node->add_child_nocopy (*child);
if (_button_map.empty()) {
@@ -218,25 +206,25 @@ DeviceProfile::get_state () const
for (ButtonActionMap::const_iterator b = _button_map.begin(); b != _button_map.end(); ++b) {
XMLNode* n = new XMLNode ("Button");
- n->add_property ("name", Button::id_to_name (b->first));
+ n->set_property ("name", Button::id_to_name (b->first));
if (!b->second.plain.empty()) {
- n->add_property ("plain", b->second.plain);
+ n->set_property ("plain", b->second.plain);
}
if (!b->second.control.empty()) {
- n->add_property ("control", b->second.control);
+ n->set_property ("control", b->second.control);
}
if (!b->second.shift.empty()) {
- n->add_property ("shift", b->second.shift);
+ n->set_property ("shift", b->second.shift);
}
if (!b->second.option.empty()) {
- n->add_property ("option", b->second.option);
+ n->set_property ("option", b->second.option);
}
if (!b->second.cmdalt.empty()) {
- n->add_property ("cmdalt", b->second.cmdalt);
+ n->set_property ("cmdalt", b->second.cmdalt);
}
if (!b->second.shiftcontrol.empty()) {
- n->add_property ("shiftcontrol", b->second.shiftcontrol);
+ n->set_property ("shiftcontrol", b->second.shiftcontrol);
}
buttons->add_child_nocopy (*n);