diff --git a/libs/temporal/temporal/timeline.h b/libs/temporal/temporal/timeline.h index b4a985e4d9..6736f241be 100644 --- a/libs/temporal/temporal/timeline.h +++ b/libs/temporal/temporal/timeline.h @@ -198,6 +198,10 @@ class timepos_t : public int62_t { private: int64_t v; + /* special private constructor for use when constructing timepos_t as a + return value using arithmetic ops + */ + explicit timepos_t (bool b, int64_t v) : int62_t (b, v) {} static timepos_t _max_timepos; diff --git a/libs/temporal/timeline.cc b/libs/temporal/timeline.cc index f013739f77..b3e8dc0b97 100644 --- a/libs/temporal/timeline.cc +++ b/libs/temporal/timeline.cc @@ -264,14 +264,14 @@ timepos_t::operator/(ratio_t const & n) const /* note: v / (N/D) = (v * D) / N */ - return timepos_t (int_div_round (val() * n.denominator(), n.numerator())); + return timepos_t (is_beats(), int_div_round (val() * n.denominator(), n.numerator())); } timepos_t timepos_t::operator*(ratio_t const & n) const { assert (n >= 0); /* do not allow a position to become negative via multiplication */ - return timepos_t (int_div_round (val() * n.numerator(), n.denominator())); + return timepos_t (is_beats(), int_div_round (val() * n.numerator(), n.denominator())); } timepos_t &