diff --git a/libs/temporal/temporal/range.h b/libs/temporal/temporal/range.h index d9873ccc9a..fe76d1716a 100644 --- a/libs/temporal/temporal/range.h +++ b/libs/temporal/temporal/range.h @@ -152,7 +152,12 @@ class LIBTEMPORAL_API Range { Range (timepos_t const & s, timepos_t const & e) : _start (s), _end (e) {} Range (samplepos_t const s, samplepos_t const e) : _start (s), _end (e) {} bool empty() const { return _start == _end; } - timecnt_t length() const { return _start.distance (_end); } + + /* length semantics: start + length = end thus end - start aka * start.distance (end) + * extent semantics: 1 + (end - start) + */ + + timecnt_t extent() const { return _start.distance (_end).increment(); } RangeList subtract (RangeList &) const; diff --git a/libs/temporal/temporal/timeline.h b/libs/temporal/temporal/timeline.h index 8b8feb7e55..1e629701bc 100644 --- a/libs/temporal/temporal/timeline.h +++ b/libs/temporal/temporal/timeline.h @@ -370,6 +370,7 @@ class LIBTEMPORAL_API timecnt_t { timecnt_t & operator+= (timecnt_t const & t); timecnt_t decrement () const { return timecnt_t (_distance - 1, _position); } + timecnt_t increment () const { return timecnt_t (_distance + 1, _position); } //timecnt_t operator- (timepos_t const & t) const; //timecnt_t operator+ (timepos_t const & t) const;