diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 29244a6e74..af50f1949b 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -123,7 +123,7 @@ public: timepos_t start () const { return _start.val(); } timecnt_t length () const { return _length.val(); } timepos_t end() const; - timepos_t nt_last() const { return end().decrement_by_domain(); } + timepos_t nt_last() const { return end().decrement(); } timepos_t source_position () const; timepos_t source_relative_position (Temporal::timepos_t const &) const; diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 556ef89135..961bf03f5c 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -1969,7 +1969,7 @@ AudioRegion::find_silence (Sample threshold, samplecnt_t min_length, samplecnt_t Temporal::Range AudioRegion::body_range () const { - return Temporal::Range ((position() + _fade_in->back()->when).increment_by_domain(), end().earlier (_fade_out->back()->when)); + return Temporal::Range ((position() + _fade_in->back()->when).increment(), end().earlier (_fade_out->back()->when)); } boost::shared_ptr diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 60d0cd459e..71f5cdd498 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -692,7 +692,7 @@ Playlist::add_region (boost::shared_ptr region, timepos_t const & positi timepos_t pos = position; if (times == 1 && auto_partition) { - partition_internal (pos.decrement_by_domain(), (pos + region->length ()), true, rlock.thawlist); + partition_internal (pos.decrement(), (pos + region->length ()), true, rlock.thawlist); for (auto const & r : rlock.thawlist) { _session.add_command (new StatefulDiffCommand (r)); } @@ -1051,7 +1051,7 @@ Playlist::partition_internal (timepos_t const & start, timepos_t const & end, bo current->clear_changes (); thawlist.add (current); - current->modify_end_unchecked (pos2.decrement_by_domain(), true); + current->modify_end_unchecked (pos2.decrement(), true); } else if (overlap == Temporal::OverlapEnd) { @@ -1089,7 +1089,7 @@ Playlist::partition_internal (timepos_t const & start, timepos_t const & end, bo current->clear_changes (); thawlist.add (current); - current->modify_end_unchecked (pos2.decrement_by_domain(), true); + current->modify_end_unchecked (pos2.decrement(), true); } else if (overlap == Temporal::OverlapStart) { @@ -1227,7 +1227,7 @@ Playlist::cut (timepos_t const & start, timecnt_t const & cnt, bool result_is_hi { RegionWriteLock rlock (this); - partition_internal (start, (start+cnt).decrement_by_domain(), true, rlock.thawlist); + partition_internal (start, (start+cnt).decrement(), true, rlock.thawlist); } return the_copy; @@ -1326,7 +1326,7 @@ Playlist::duplicate_until (boost::shared_ptr region, timepos_t & positio { RegionWriteLock rl (this); - while ((position + region->length()).decrement_by_domain() < end) { + while ((position + region->length()).decrement() < end) { boost::shared_ptr copy = RegionFactory::create (region, true, false, &rl.thawlist); add_region_internal (copy, position, rl.thawlist); set_layer (copy, DBL_MAX); diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 1776b3b6d3..5956b0a02d 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -881,7 +881,7 @@ Region::cut_end (timepos_t const & new_endpoint) void Region::modify_front_unchecked (timepos_t const & new_position, bool reset_fade) { - timepos_t last = end().decrement_by_domain(); + timepos_t last = end().decrement(); timepos_t source_zero; if (position() > start()) { diff --git a/libs/evoral/ControlList.cc b/libs/evoral/ControlList.cc index 5b4dbb0cb3..050e36a34c 100644 --- a/libs/evoral/ControlList.cc +++ b/libs/evoral/ControlList.cc @@ -1109,10 +1109,10 @@ ControlList::shift (timepos_t const & time, timecnt_t const & distance) } pos += distance; } else if (distance.is_negative() && pos > 0) { - ControlEvent cp (pos.decrement_by_domain(), 0.0); + ControlEvent cp (pos.decrement(), 0.0); iterator s = lower_bound (_events.begin(), _events.end(), &cp, time_comparator); if (s != _events.end ()) { - _events.insert (s, new ControlEvent (pos.decrement_by_domain(), v0)); + _events.insert (s, new ControlEvent (pos.decrement(), v0)); } } if (!dst_guard_exists) { diff --git a/libs/temporal/temporal/timeline.h b/libs/temporal/temporal/timeline.h index beb08a45ff..66b94b9554 100644 --- a/libs/temporal/temporal/timeline.h +++ b/libs/temporal/temporal/timeline.h @@ -181,8 +181,7 @@ class LIBTEMPORAL_API timepos_t : public int62_t { * timepos_t that is the previous (earlier) possible position given * this one */ - timepos_t decrement () const { return timepos_t (flagged(), val() > 0 ? val() - 1 : 0); /* cannot go negative */ } - timepos_t decrement_by_domain () const { return timepos_t (flagged(), + timepos_t decrement () const { return timepos_t (flagged(), is_beats() ? (val() > 0 ? val() - 1 : 0) : /* reduce by 1 tick */ (val() > samples_to_superclock (1, TEMPORAL_SAMPLE_RATE) ? val() - samples_to_superclock (1, TEMPORAL_SAMPLE_RATE) : 0)); } @@ -190,8 +189,7 @@ class LIBTEMPORAL_API timepos_t : public int62_t { /* purely for reasons of symmetry with ::decrement(), return a * timepos_t that is the next (later) possible position given this one */ - timepos_t increment () const { return timepos_t (flagged(), val() + 1); } - timepos_t increment_by_domain () const { return timepos_t (flagged(), (is_beats() ? (val() + 1) : (val() + samples_to_superclock (1, TEMPORAL_SAMPLE_RATE)))); } + timepos_t increment () const { return timepos_t (flagged(), (is_beats() ? (val() + 1) : (val() + samples_to_superclock (1, TEMPORAL_SAMPLE_RATE)))); } timepos_t & operator+=(timecnt_t const & d); @@ -393,10 +391,8 @@ class LIBTEMPORAL_API timecnt_t { * samples_to_superclock(1) */ - timecnt_t decrement () const { return timecnt_t (_distance - 1, _position); } - timecnt_t decrement_by_domain () const { return timecnt_t (_distance.flagged() ? _distance - 1 : _distance - samples_to_superclock (1, TEMPORAL_SAMPLE_RATE), _position); } - timecnt_t increment () const { return timecnt_t (_distance + 1, _position); } - timecnt_t increment_by_domain () const { return timecnt_t (_distance.flagged() ? _distance + 1 : _distance + samples_to_superclock (1, TEMPORAL_SAMPLE_RATE), _position); } + timecnt_t decrement () const { return timecnt_t (_distance.flagged() ? _distance - 1 : _distance - samples_to_superclock (1, TEMPORAL_SAMPLE_RATE), _position); } + timecnt_t increment () const { return timecnt_t (_distance.flagged() ? _distance + 1 : _distance + samples_to_superclock (1, TEMPORAL_SAMPLE_RATE), _position); } //timecnt_t operator- (timepos_t const & t) const; //timecnt_t operator+ (timepos_t const & t) const;