diff options
author | Carl Hetherington <carl@carlh.net> | 2010-03-31 22:45:27 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-03-31 22:45:27 +0000 |
commit | afc5e3bd0251dbcdbde27036569eb1acab026991 (patch) | |
tree | e8b85a38bb9707b15f1a4d721c5b8b8901245109 /libs/pbd/pbd/properties.h | |
parent | 7f8b337d309fe62a442ef8c3086b7eb97c7e57e9 (diff) |
Rework to set Stateful properties automagically in the Stateful class rather than delegating to subclasses.
git-svn-id: svn://localhost/ardour2/branches/3.0@6817 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd/properties.h')
-rw-r--r-- | libs/pbd/pbd/properties.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/pbd/pbd/properties.h b/libs/pbd/pbd/properties.h index 691ab9c4ad..31197030f9 100644 --- a/libs/pbd/pbd/properties.h +++ b/libs/pbd/pbd/properties.h @@ -118,6 +118,12 @@ public: } bool changed () const { return _have_old; } + void set_state_from_property (PropertyBase const * p) { + T v = dynamic_cast<const PropertyTemplate<T>* > (p)->val (); + if (v != _current) { + set (v); + } + } protected: /** Constructs a PropertyTemplate with a default |