diff options
Diffstat (limited to 'libs/ardour/region.cc')
-rw-r--r-- | libs/ardour/region.cc | 77 |
1 files changed, 21 insertions, 56 deletions
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 89abdbd230..0ec8ee001b 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -73,10 +73,7 @@ namespace ARDOUR { PBD::PropertyDescriptor<float> stretch; PBD::PropertyDescriptor<float> shift; PBD::PropertyDescriptor<PositionLockStyle> position_lock_style; - PBD::PropertyDescriptor<framepos_t> last_relayer_bounds_from; - PBD::PropertyDescriptor<framepos_t> last_relayer_bounds_to; - PBD::PropertyDescriptor<uint64_t> last_layer_op_add; - PBD::PropertyDescriptor<uint64_t> last_layer_op_bounds_change; + PBD::PropertyDescriptor<uint64_t> layering_index; } } @@ -131,14 +128,8 @@ Region::make_property_quarks () DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for shift = %1\n", Properties::shift.property_id)); Properties::position_lock_style.property_id = g_quark_from_static_string (X_("positional-lock-style")); DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for position_lock_style = %1\n", Properties::position_lock_style.property_id)); - Properties::last_relayer_bounds_from.property_id = g_quark_from_static_string (X_("last-relayer-bounds-from")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for last_relayer_bounds_from = %1\n", Properties::last_relayer_bounds_from.property_id)); - Properties::last_relayer_bounds_to.property_id = g_quark_from_static_string (X_("last-relayer-bounds-to")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for last_relayer_bounds_to = %1\n", Properties::last_relayer_bounds_to.property_id)); - Properties::last_layer_op_add.property_id = g_quark_from_static_string (X_("last-layer-op-add")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for last_layer_op_add = %1\n", Properties::last_layer_op_add.property_id)); - Properties::last_layer_op_bounds_change.property_id = g_quark_from_static_string (X_("last-layer-op-bounds-change")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for last_layer_op_bounds_change = %1\n", Properties::last_layer_op_bounds_change.property_id)); + Properties::layering_index.property_id = g_quark_from_static_string (X_("layering-index")); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for layering_index = %1\n", Properties::layering_index.property_id)); } void @@ -169,10 +160,7 @@ Region::register_properties () add_property (_stretch); add_property (_shift); add_property (_position_lock_style); - add_property (_last_relayer_bounds_from); - add_property (_last_relayer_bounds_to); - add_property (_last_layer_op_add); - add_property (_last_layer_op_bounds_change); + add_property (_layering_index); } #define REGION_DEFAULT_STATE(s,l) \ @@ -199,10 +187,7 @@ Region::register_properties () , _stretch (Properties::stretch, 1.0) \ , _shift (Properties::shift, 1.0) \ , _position_lock_style (Properties::position_lock_style, _type == DataType::AUDIO ? AudioTime : MusicTime) \ - , _last_relayer_bounds_from (Properties::last_relayer_bounds_from, 0) \ - , _last_relayer_bounds_to (Properties::last_relayer_bounds_to, 0) \ - , _last_layer_op_add (Properties::last_layer_op_add, 0) \ - , _last_layer_op_bounds_change (Properties::last_layer_op_bounds_change, 0) + , _layering_index (Properties::layering_index, 0) #define REGION_COPY_STATE(other) \ _sync_marked (Properties::sync_marked, other->_sync_marked) \ @@ -228,10 +213,7 @@ Region::register_properties () , _stretch (Properties::stretch, other->_stretch) \ , _shift (Properties::shift, other->_shift) \ , _position_lock_style (Properties::position_lock_style, other->_position_lock_style) \ - , _last_relayer_bounds_from (Properties::last_relayer_bounds_from, other->_last_relayer_bounds_from) \ - , _last_relayer_bounds_to (Properties::last_relayer_bounds_to, other->_last_relayer_bounds_to) \ - , _last_layer_op_add (Properties::last_layer_op_add, other->_last_layer_op_add) \ - , _last_layer_op_bounds_change (Properties::last_layer_op_bounds_change, other->_last_layer_op_bounds_change) + , _layering_index (Properties::layering_index, other->_layering_index) /* derived-from-derived constructor (no sources in constructor) */ Region::Region (Session& s, framepos_t start, framecnt_t length, const string& name, DataType type) @@ -243,6 +225,7 @@ Region::Region (Session& s, framepos_t start, framecnt_t length, const string& n , _first_edit (EditChangesNothing) { register_properties (); + /* no sources at this point */ } @@ -1134,12 +1117,9 @@ Region::set_layer (layer_t l) { if (_layer != l) { _layer = l; + send_change (Properties::layer); } - - Evoral::Range<framepos_t> const b = bounds (); - _last_relayer_bounds_from = b.from; - _last_relayer_bounds_to = b.to; } XMLNode& @@ -1330,19 +1310,6 @@ Region::send_change (const PropertyChange& what_changed) } } -void -Region::set_last_layer_op (LayerOp op, uint64_t when) -{ - switch (op) { - case LayerOpAdd: - _last_layer_op_add = when; - break; - case LayerOpBoundsChange: - _last_layer_op_bounds_change = when; - break; - } -} - bool Region::overlap_equivalent (boost::shared_ptr<const Region> other) const { @@ -1683,24 +1650,22 @@ Region::post_set (const PropertyChange& pc) } } -uint64_t -Region::last_layer_op (LayerOp op) const +void +Region::set_pending_layer (double l) { - switch (op) { - case LayerOpAdd: - return _last_layer_op_add; - case LayerOpBoundsChange: - return _last_layer_op_bounds_change; - } - - /* NOTREACHED */ - return 0; + _pending_layer = l; } -Evoral::Range<framepos_t> -Region::bounds () const +bool +Region::reset_pending_layer () { - return Evoral::Range<framepos_t> (_position, _position + _length); + bool const had = _pending_layer; + _pending_layer = boost::optional<double> (); + return had; } - +boost::optional<double> +Region::pending_layer () const +{ + return _pending_layer; +} |