diff options
author | Carl Hetherington <carl@carlh.net> | 2010-08-25 17:31:33 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-08-25 17:31:33 +0000 |
commit | 7b2975244165b4ffd1dcf4080c1be4c8dcbc6708 (patch) | |
tree | b3010f51f7c3fa0534c0813e51bbeef13200f6a0 /libs/pbd/stateful.cc | |
parent | 167c439002bde2b20399d733cd5d38d3674668c3 (diff) |
Rename various things in the property system.
git-svn-id: svn://localhost/ardour2/branches/3.0@7681 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/stateful.cc')
-rw-r--r-- | libs/pbd/stateful.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc index 1c3d08b3a9..f58c64603e 100644 --- a/libs/pbd/stateful.cc +++ b/libs/pbd/stateful.cc @@ -174,17 +174,18 @@ Stateful::diff (PropertyList& before, PropertyList& after, Command* cmd) const } } -/** Set state of some/all _properties from an XML node. - * @param owner_state Node. - * @return PropertyChanges made. +/** Set our property values from an XML node. + * Derived types can call this from ::set_state() (or elsewhere) + * to get basic property setting done. + * @return IDs of properties that were changed. */ PropertyChange -Stateful::set_properties (XMLNode const & owner_state) +Stateful::set_values (XMLNode const & node) { PropertyChange c; for (OwnedPropertyList::iterator i = _properties->begin(); i != _properties->end(); ++i) { - if (i->second->set_state_from_owner_state (owner_state)) { + if (i->second->set_value (node)) { c.add (i->first); } } @@ -195,7 +196,7 @@ Stateful::set_properties (XMLNode const & owner_state) } PropertyChange -Stateful::set_properties (const PropertyList& property_list) +Stateful::apply_changes (const PropertyList& property_list) { PropertyChange c; PropertyList::const_iterator p; @@ -209,7 +210,7 @@ Stateful::set_properties (const PropertyList& property_list) for (PropertyList::const_iterator i = property_list.begin(); i != property_list.end(); ++i) { if ((p = _properties->find (i->first)) != _properties->end()) { DEBUG_TRACE (DEBUG::Stateful, string_compose ("actually setting property %1\n", p->second->property_name())); - if (set_property (*i->second)) { + if (apply_change (*i->second)) { c.add (i->first); } } else { @@ -232,7 +233,7 @@ void Stateful::add_properties (XMLNode& owner_state) { for (OwnedPropertyList::iterator i = _properties->begin(); i != _properties->end(); ++i) { - i->second->add_state_to_owner_state (owner_state); + i->second->get_value (owner_state); } } @@ -302,14 +303,14 @@ Stateful::changed() const } bool -Stateful::set_property (const PropertyBase& prop) +Stateful::apply_change (const PropertyBase& prop) { OwnedPropertyList::iterator i = _properties->find (prop.property_id()); if (i == _properties->end()) { return false; } - i->second->set_state_from_property (&prop); + i->second->apply_change (&prop); return true; } |