diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-24 13:46:07 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-24 13:46:07 -0400 |
commit | 2ea5962af2a389277703c6eebc2160cf52302468 (patch) | |
tree | 17e13680e0823c8eb6d933f9ff4a7f466871c051 /libs/surfaces/control_protocol | |
parent | 2b81d4d0feb06a18d31463ab884de5e56722a346 (diff) |
rationalize save/restore of control surface "feedback" property
Diffstat (limited to 'libs/surfaces/control_protocol')
-rw-r--r-- | libs/surfaces/control_protocol/control_protocol.cc | 13 | ||||
-rw-r--r-- | libs/surfaces/control_protocol/control_protocol/control_protocol.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc index 71cae36086..6ac673925a 100644 --- a/libs/surfaces/control_protocol/control_protocol.cc +++ b/libs/surfaces/control_protocol/control_protocol.cc @@ -374,6 +374,19 @@ ControlProtocol::get_state () XMLNode* node = new XMLNode (state_node_name); node->add_property ("name", _name); + node->add_property ("feedback", get_feedback() ? "yes" : "no"); return *node; } + +int +ControlProtocol::set_state (XMLNode const & node, int /* version */) +{ + const XMLProperty* prop; + + if ((prop = node.property ("feedback")) != 0) { + set_feedback (string_is_affirmative (prop->value())); + } + + return 0; +} diff --git a/libs/surfaces/control_protocol/control_protocol/control_protocol.h b/libs/surfaces/control_protocol/control_protocol/control_protocol.h index f5af008e4a..13b8dcad7a 100644 --- a/libs/surfaces/control_protocol/control_protocol/control_protocol.h +++ b/libs/surfaces/control_protocol/control_protocol/control_protocol.h @@ -135,6 +135,8 @@ class LIBCONTROLCP_API ControlProtocol : public PBD::Stateful, public PBD::Scope virtual void tear_down_gui() { } XMLNode& get_state (); + int set_state (XMLNode const &, int version); + static const std::string state_node_name; protected: |