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/ardour/region.cc | |
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/ardour/region.cc')
-rw-r--r-- | libs/ardour/region.cc | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index bb9338d98d..8625b17a8a 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1498,109 +1498,6 @@ Region::use_sources (SourceList const & s) } } - -bool -Region::set_property (const PropertyBase& prop) -{ - DEBUG_TRACE (DEBUG::Properties, string_compose ("region %1 set property %2\n", _name.val(), prop.property_name())); - - if (prop == Properties::muted.property_id) { - bool val = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - if (val != _muted) { - DEBUG_TRACE (DEBUG::Properties, string_compose ("region %1 muted changed from %2 to %3", - _name.val(), _muted.val(), val)); - _muted = val; - return true; - } - } else if (prop == Properties::opaque.property_id) { - bool val = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - if (val != _opaque) { - DEBUG_TRACE (DEBUG::Properties, string_compose ("region %1 opaque changed from %2 to %3", - _name.val(), _opaque.val(), val)); - _opaque = val; - return true; - } - } else if (prop == Properties::locked.property_id) { - bool val = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - if (val != _locked) { - DEBUG_TRACE (DEBUG::Properties, string_compose ("region %1 locked changed from %2 to %3", - _name.val(), _locked.val(), val)); - _locked = val; - return true; - } - } else if (prop == Properties::automatic.property_id) { - _automatic = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - } else if (prop == Properties::whole_file.property_id) { - _whole_file = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - } else if (prop == Properties::import.property_id) { - _import = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - } else if (prop == Properties::external.property_id) { - _external = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - } else if (prop == Properties::sync_marked.property_id) { - _sync_marked = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - } else if (prop == Properties::left_of_split.property_id) { - _left_of_split = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - } else if (prop == Properties::right_of_split.property_id) { - _right_of_split = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - } else if (prop == Properties::hidden.property_id) { - bool val = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - if (val != _hidden) { - _hidden = val; - return true; - } - } else if (prop == Properties::position_locked.property_id) { - _position_locked = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val(); - } else if (prop == Properties::start.property_id) { - framepos_t val = dynamic_cast<const PropertyTemplate<framepos_t>*>(&prop)->val(); - if (val != _start) { - DEBUG_TRACE (DEBUG::Properties, string_compose ("region %1 start changed from %2 to %3", - _name.val(), _start, val)); - _start = val; - return true; - } - } else if (prop == Properties::length.property_id) { - framecnt_t val = dynamic_cast<const PropertyTemplate<framecnt_t>* > (&prop)->val(); - if (val != _length) { - DEBUG_TRACE (DEBUG::Properties, string_compose ("region %1 length changed from %2 to %3", - _name.val(), _length, val)); - _length = val; - return true; - } - } else if (prop == Properties::position.property_id) { - framepos_t val = dynamic_cast<const PropertyTemplate<framepos_t>*>(&prop)->val(); - if (val != _position) { - DEBUG_TRACE (DEBUG::Properties, string_compose ("region %1 position changed from %2 to %3", - _name.val(), _position, val)); - _position = val; - return true; - } - } else if (prop == Properties::sync_position.property_id) { - framepos_t val = dynamic_cast<const PropertyTemplate<framepos_t>*>(&prop)->val(); - if (val != _sync_position) { - _sync_position = val; - return true; - } - } else if (prop == Properties::layer.property_id) { - layer_t val = dynamic_cast<const PropertyTemplate<layer_t>*>(&prop)->val(); - if (val != _layer) { - _layer = val; - return true; - } - } else if (prop == Properties::ancestral_start.property_id) { - _ancestral_start = dynamic_cast<const PropertyTemplate<framepos_t>*>(&prop)->val(); - } else if (prop == Properties::ancestral_length.property_id) { - _ancestral_length = dynamic_cast<const PropertyTemplate<framecnt_t>*>(&prop)->val(); - } else if (prop == Properties::stretch.property_id) { - _stretch = dynamic_cast<const PropertyTemplate<float>*>(&prop)->val(); - } else if (prop == Properties::shift.property_id) { - _shift = dynamic_cast<const PropertyTemplate<float>*>(&prop)->val(); - } else { - return SessionObject::set_property (prop); - } - - return false; -} - PropertyList* Region::property_factory (const XMLNode& history_node) const { |