diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2017-04-15 12:13:39 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2017-04-19 09:36:59 +1000 |
commit | 0656d5ab1a44ceec3c3f0713b8c9fa1fbe9054f7 (patch) | |
tree | 874e555d642c8fd319c26817f43d67d26793c245 /libs | |
parent | ac8b5192cd69f135efbd039c198529a8f3db7ef7 (diff) |
Use XMLNode::get/set_property API in Faderport surface
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaces/faderport8/faderport8.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libs/surfaces/faderport8/faderport8.cc b/libs/surfaces/faderport8/faderport8.cc index 08e2cc8560..b0037b72c0 100644 --- a/libs/surfaces/faderport8/faderport8.cc +++ b/libs/surfaces/faderport8/faderport8.cc @@ -694,12 +694,12 @@ FaderPort8::get_state () continue; } XMLNode* btn = new XMLNode (X_("Button")); - btn->add_property (X_("id"), name); + btn->set_property (X_("id"), name); if (!i->second.action(true).empty ()) { - btn->add_property ("press", i->second.action(true)._action_name); + btn->set_property ("press", i->second.action(true)._action_name); } if (!i->second.action(false).empty ()) { - btn->add_property ("release", i->second.action(false)._action_name); + btn->set_property ("release", i->second.action(false)._action_name); } node.add_child_nocopy (*btn); } @@ -743,23 +743,23 @@ FaderPort8::set_state (const XMLNode& node, int version) if ((*n)->name() != X_("Button")) { continue; } - XMLProperty const* prop = (*n)->property (X_("id")); - if (!prop) { + + std::string id_str; + if (!(*n)->get_property (X_("id"), id_str)) { continue; } FP8Controls::ButtonId id; - if (!_ctrls.button_name_to_enum (prop->value(), id)) { + if (!_ctrls.button_name_to_enum (id_str, id)) { continue; } - prop = (*n)->property (X_("press")); - if (prop) { - set_button_action (id, true, prop->value()); + std::string action_str; + if ((*n)->get_property (X_("press"), action_str)) { + set_button_action (id, true, action_str); } - prop = (*n)->property (X_("release")); - if (prop) { - set_button_action (id, false, prop->value()); + if ((*n)->get_property (X_("release"), action_str)) { + set_button_action (id, false, action_str); } } |