diff options
author | Carl Hetherington <carl@carlh.net> | 2010-08-25 17:31:41 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-08-25 17:31:41 +0000 |
commit | fde848282d43db6f7b337a959b5268236d377404 (patch) | |
tree | 0ee65ec91cccb654c99d40dc64fd3f8ce829d278 /libs/pbd/pbd/sequence_property.h | |
parent | 7b2975244165b4ffd1dcf4080c1be4c8dcbc6708 (diff) |
Move various code up the Property / Stateful hierarchies.
git-svn-id: svn://localhost/ardour2/branches/3.0@7682 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd/sequence_property.h')
-rw-r--r-- | libs/pbd/pbd/sequence_property.h | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/libs/pbd/pbd/sequence_property.h b/libs/pbd/pbd/sequence_property.h index 1486437f58..e92aa5c68e 100644 --- a/libs/pbd/pbd/sequence_property.h +++ b/libs/pbd/pbd/sequence_property.h @@ -180,8 +180,46 @@ class SequenceProperty : public PropertyBase } } + SequenceProperty<Container>* maybe_clone_self_if_found_in_history_node (XMLNode const & node) const { + + XMLNodeList const children = node.children (); + + for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { + + if ((*i)->name() == capitalize (property_name())) { + + SequenceProperty<Container>* p = create (); + + if (p->set_change (**i)) { + return p; + } else { + delete p; + } + } + } + + return 0; + } + + void clear_owned_history () { + for (typename Container::iterator i = begin(); i != end(); ++i) { + (*i)->clear_history (); + } + } + + void rdiff (std::vector<StatefulDiffCommand*>& cmds) const { + for (typename Container::const_iterator i = begin(); i != end(); ++i) { + if ((*i)->changed ()) { + StatefulDiffCommand* sdc = new StatefulDiffCommand (*i); + cmds.push_back (sdc); + } + } + } + + + Container rlist() { return _val; } - + /* Wrap salient methods of Sequence */ |