diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2016-08-26 20:46:04 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2017-04-19 09:36:49 +1000 |
commit | 64e1bf5ab793a7df5e2f4c2d68d2a280f8570470 (patch) | |
tree | a3db9ac3ff47cf8e7a4931151baf68dd48795368 /libs/ardour/plugin.cc | |
parent | 530c6c3b3829d4fba63587b77ab23958ca747fe7 (diff) |
Use XMLNode::get/set_property API in ARDOUR::Plugin class
Diffstat (limited to 'libs/ardour/plugin.cc')
-rw-r--r-- | libs/ardour/plugin.cc | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index 7c96922571..17984361b0 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -467,21 +467,9 @@ Plugin::parameter_changed_externally (uint32_t which, float /* value */) int Plugin::set_state (const XMLNode& node, int /*version*/) { - XMLProperty const * p = node.property (X_("last-preset-uri")); - if (p) { - _last_preset.uri = p->value (); - } - - p = node.property (X_("last-preset-label")); - if (p) { - _last_preset.label = p->value (); - } - - p = node.property (X_("parameter-changed-since-last-preset")); - if (p) { - _parameter_changed_since_last_preset = string_is_affirmative (p->value ()); - } - + node.get_property (X_("last-preset-uri"), _last_preset.uri); + node.get_property (X_("last-preset-label"), _last_preset.label); + node.get_property (X_("parameter-changed-since-last-preset"), _parameter_changed_since_last_preset); return 0; } @@ -491,9 +479,9 @@ Plugin::get_state () XMLNode* root = new XMLNode (state_node_name ()); LocaleGuard lg; - root->add_property (X_("last-preset-uri"), _last_preset.uri); - root->add_property (X_("last-preset-label"), _last_preset.label); - root->add_property (X_("parameter-changed-since-last-preset"), _parameter_changed_since_last_preset ? X_("yes") : X_("no")); + root->set_property (X_("last-preset-uri"), _last_preset.uri); + root->set_property (X_("last-preset-label"), _last_preset.label); + root->set_property (X_("parameter-changed-since-last-preset"), _parameter_changed_since_last_preset); #ifndef NO_PLUGIN_STATE add_state (root); |