summaryrefslogtreecommitdiff
path: root/libs/temporal
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2018-02-12 07:04:47 -0500
committerBen Loftis <ben@harrisonconsoles.com>2018-02-12 11:44:37 -0600
commit9a20433d9890af935e03f004fa7707f8d2942c31 (patch)
treefaf889a54af3a5dd7046f8784f2871e6a7a608cb /libs/temporal
parent8e4e7fde05c34dd09b73494df5b8d8e588dae02c (diff)
fix definition of Temporal::Beats::max()
Ticks can exceed PPQN, but if beats are already INT32_MAX, ::normalize() will not work correctly
Diffstat (limited to 'libs/temporal')
-rw-r--r--libs/temporal/temporal/beats.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/libs/temporal/temporal/beats.h b/libs/temporal/temporal/beats.h
index 3c92ac7561..e1790668d5 100644
--- a/libs/temporal/temporal/beats.h
+++ b/libs/temporal/temporal/beats.h
@@ -308,8 +308,7 @@ namespace std {
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,
@@ -317,8 +316,7 @@ namespace std {
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);
}
};
}