Ticks can exceed PPQN, but if beats are already INT32_MAX, ::normalize() will not work correctly
template<>
struct numeric_limits<Temporal::Beats> {
static Temporal::Beats lowest() {
template<>
struct numeric_limits<Temporal::Beats> {
static Temporal::Beats lowest() {
- return Temporal::Beats(std::numeric_limits<int32_t>::min(),
- std::numeric_limits<int32_t>::min());
+ return Temporal::Beats(std::numeric_limits<int32_t>::min(), std::numeric_limits<int32_t>::min());
}
/* We don't define min() since this has different behaviour for integral and floating point types,
}
/* We don't define min() since this has different behaviour for integral and floating point types,
than a confusing one. */
static Temporal::Beats max() {
than a confusing one. */
static Temporal::Beats max() {
- return Temporal::Beats(std::numeric_limits<int32_t>::max(),
- std::numeric_limits<int32_t>::max());
+ return Temporal::Beats(std::numeric_limits<int32_t>::max(), Temporal::Beats::PPQN-1);