diff options
author | Jan Holthuis <jholthuis@mixxx.org> | 2021-07-10 00:03:52 +0200 |
---|---|---|
committer | Jan Holthuis <jholthuis@mixxx.org> | 2021-07-10 00:09:31 +0200 |
commit | c3987c59eb8b3b7b15b9a91159a796f8795ac0ff (patch) | |
tree | 18d25be154b6e37933dcc399af63f59bc717ad2a /src/audio | |
parent | 1a3b8d0583dc679d8b9469960de6012c6a55c9ec (diff) |
SeratoBeatsImporter: Round beats to nearest frame position
This should fix lp1935703: https://bugs.launchpad.net/mixxx/+bug/1935703
Diffstat (limited to 'src/audio')
-rw-r--r-- | src/audio/frame.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/audio/frame.h b/src/audio/frame.h index 71b7059529..b1c619f0f3 100644 --- a/src/audio/frame.h +++ b/src/audio/frame.h @@ -109,6 +109,12 @@ class FramePos final { return FramePos(std::floor(value())); } + /// Return position rounded to the nearest full frame position, without + /// the fractional part. + [[nodiscard]] FramePos toNearestFrameBoundary() const { + return FramePos(std::round(value())); + } + FramePos& operator+=(FrameDiff_t increment) { DEBUG_ASSERT(isValid()); m_framePosition += increment; |