diff options
author | Carl Hetherington <carl@carlh.net> | 2012-01-20 18:02:48 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-01-20 18:02:48 +0000 |
commit | 5a53f2f1b9977e909f7720c9aa30333b0ec0572b (patch) | |
tree | 06fb01663d41dcef3f9952e3d8b58e6b823b4071 /gtk2_ardour/gui_object.h | |
parent | 3396a9a851180ef73c6af9c42fc63897bb965390 (diff) |
Simple approach to putting plugin controls into the
processor box.
git-svn-id: svn://localhost/ardour2/branches/3.0@11288 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/gui_object.h')
-rw-r--r-- | gtk2_ardour/gui_object.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gtk2_ardour/gui_object.h b/gtk2_ardour/gui_object.h index 3cbd85c171..694a5e9212 100644 --- a/gtk2_ardour/gui_object.h +++ b/gtk2_ardour/gui_object.h @@ -46,23 +46,20 @@ public: std::string get_string (const std::string& id, const std::string& prop_name, bool* empty = 0); template<typename T> void set (const std::string& id, const std::string& prop_name, const T& val) { - XMLNode* child = find_node (id); - if (!child) { - child = new XMLNode (X_("Object")); - child->add_property (X_("id"), id); - _state.add_child_nocopy (*child); - } - + XMLNode* child = get_or_add_node (id); std::stringstream s; s << val; child->add_property (prop_name.c_str(), s.str()); } std::list<std::string> all_ids () const; + + static XMLNode* get_node (const XMLNode *, const std::string &); + XMLNode* get_or_add_node (const std::string &); + static XMLNode* get_or_add_node (XMLNode *, const std::string &); private: - XMLNode* find_node (const std::string &) const; - + XMLNode _state; }; |