increment/decrement name changes ... out with old in with the new (libs

This commit is contained in:
Paul Davis 2022-10-07 17:30:35 -06:00
parent 45e21de209
commit 88396347e6
6 changed files with 14 additions and 18 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_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;

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_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<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_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> region, timepos_t & positio
{
RegionWriteLock rl (this);
while ((position + region->length()).decrement_by_domain() < end) {
while ((position + region->length()).decrement() < 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

@ -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()) {

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_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) {

View File

@ -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;