libs: use {de,in}crement_by_domain() instead of {de,in} (libs)

This commit is contained in:
Paul Davis
2022-10-07 16:10:55 -06:00
parent 27d5843f7a
commit be9fdd9873
5 changed files with 13 additions and 10 deletions

View File

@@ -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(); }
timepos_t nt_last() const { return end().decrement_by_domain(); }
timepos_t source_position () const;
timepos_t source_relative_position (Temporal::timepos_t const &) const;

View File

@@ -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(), end().earlier (_fade_out->back()->when));
return Temporal::Range ((position() + _fade_in->back()->when).increment_by_domain(), end().earlier (_fade_out->back()->when));
}
boost::shared_ptr<Region>

View File

@@ -692,7 +692,7 @@ Playlist::add_region (boost::shared_ptr<Region> region, timepos_t const & positi
timepos_t pos = position;
if (times == 1 && auto_partition) {
partition_internal (pos.decrement(), (pos + region->length ()), true, rlock.thawlist);
partition_internal (pos.decrement_by_domain(), (pos + region->length ()), true, rlock.thawlist);
for (auto const & r : rlock.thawlist) {
_session.add_command (new StatefulDiffCommand (r));
}
@@ -1050,7 +1050,8 @@ Playlist::partition_internal (timepos_t const & start, timepos_t const & end, bo
current->clear_changes ();
thawlist.add (current);
current->modify_end_unchecked (pos2.decrement(), true);
current->modify_end_unchecked (pos2.decrement_by_domain(), true);
} else if (overlap == Temporal::OverlapEnd) {
@@ -1087,7 +1088,8 @@ Playlist::partition_internal (timepos_t const & start, timepos_t const & end, bo
current->clear_changes ();
thawlist.add (current);
current->modify_end_unchecked (pos2.decrement(), true);
current->modify_end_unchecked (pos2.decrement_by_domain(), true);
} else if (overlap == Temporal::OverlapStart) {
@@ -1225,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(), true, rlock.thawlist);
partition_internal (start, (start+cnt).decrement_by_domain(), true, rlock.thawlist);
}
return the_copy;
@@ -1324,7 +1326,7 @@ Playlist::duplicate_until (boost::shared_ptr<Region> region, timepos_t & positio
{
RegionWriteLock rl (this);
while (position + region->length().decrement() < end) {
while ((position + region->length()).decrement_by_domain() < end) {
boost::shared_ptr<Region> copy = RegionFactory::create (region, true, false, &rl.thawlist);
add_region_internal (copy, position, rl.thawlist);
set_layer (copy, DBL_MAX);

View File

@@ -877,10 +877,11 @@ Region::cut_end (timepos_t const & new_endpoint)
modify_end_unchecked (new_endpoint, true);
}
void
Region::modify_front_unchecked (timepos_t const & new_position, bool reset_fade)
{
timepos_t last = end().decrement();
timepos_t last = end().decrement_by_domain();
timepos_t source_zero;
if (position() > start()) {

View File

@@ -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(), 0.0);
ControlEvent cp (pos.decrement_by_domain(), 0.0);
iterator s = lower_bound (_events.begin(), _events.end(), &cp, time_comparator);
if (s != _events.end ()) {
_events.insert (s, new ControlEvent (pos.decrement(), v0));
_events.insert (s, new ControlEvent (pos.decrement_by_domain(), v0));
}
}
if (!dst_guard_exists) {