summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-03-31 22:45:27 +0000
committerCarl Hetherington <carl@carlh.net>2010-03-31 22:45:27 +0000
commitafc5e3bd0251dbcdbde27036569eb1acab026991 (patch)
treee8b85a38bb9707b15f1a4d721c5b8b8901245109 /libs/ardour
parent7f8b337d309fe62a442ef8c3086b7eb97c7e57e9 (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')
-rw-r--r--libs/ardour/ardour/audioregion.h1
-rw-r--r--libs/ardour/ardour/region.h1
-rw-r--r--libs/ardour/audioregion.cc48
-rw-r--r--libs/ardour/region.cc103
4 files changed, 0 insertions, 153 deletions
diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h
index 59876d6e56..f9c13b2bbe 100644
--- a/libs/ardour/ardour/audioregion.h
+++ b/libs/ardour/ardour/audioregion.h
@@ -199,7 +199,6 @@ class AudioRegion : public Region
PBD::Property<gain_t> _scale_amplitude;
void register_properties ();
- bool set_property (const PBD::PropertyBase& prop);
void post_set ();
void init ();
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index 09dd8f203c..a44b3fcb46 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -344,7 +344,6 @@ class Region
virtual int _set_state (const XMLNode&, int version, PBD::PropertyChange& what_changed, bool send_signal);
- bool set_property (const PBD::PropertyBase&);
void register_properties ();
private:
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index 3430eb5128..be6cce251a 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -691,54 +691,6 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_
return 0;
}
-bool
-AudioRegion::set_property (const PropertyBase& prop)
-{
- DEBUG_TRACE (DEBUG::Properties, string_compose ("audio region %1 set property %2\n", _name.val(), prop.property_name()));
-
- if (prop == Properties::envelope_active.property_id) {
- bool val = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val();
- if (val != _envelope_active) {
- _envelope_active = val;
- return true;
- }
- } else if (prop == Properties::default_fade_in.property_id) {
- bool val = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val();
- if (val != _default_fade_in) {
- _default_fade_in = val;
- return true;
- }
- } else if (prop == Properties::default_fade_out.property_id) {
- bool val = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val();
- if (val != _default_fade_out) {
- _default_fade_out = val;
- return true;
- }
- } else if (prop == Properties::fade_in_active.property_id) {
- bool val = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val();
- if (val != _fade_in_active) {
- _fade_in_active = val;
- return true;
- }
- } else if (prop == Properties::fade_out_active.property_id) {
- bool val = dynamic_cast<const PropertyTemplate<bool>*>(&prop)->val();
- if (val != _fade_out_active) {
- _fade_out_active = val;
- return true;
- }
- } else if (prop == Properties::scale_amplitude.property_id) {
- gain_t val = dynamic_cast<const PropertyTemplate<gain_t>*>(&prop)->val();
- if (val != _scale_amplitude) {
- _scale_amplitude = val;
- return true;
- }
- } else {
- return Region::set_property (prop);
- }
-
- return false;
-}
-
int
AudioRegion::set_state (const XMLNode& node, int version)
{
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
{