diff options
author | Jan Holthuis <jholthuis@mixxx.org> | 2021-07-10 14:54:15 +0200 |
---|---|---|
committer | Jan Holthuis <jholthuis@mixxx.org> | 2021-07-10 14:54:40 +0200 |
commit | 2253c7800ef329b4193933b01e03ac05297acf85 (patch) | |
tree | f34177006d2276f8835f97a1f101d0a104c0f2a2 /src/audio | |
parent | 3ef395bf0b89b2f152d76b665f0557aec88e0dc1 (diff) |
FramePos: Add method to rount to upper frame boundary
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 b1c619f0f3..c967eb84a7 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 next upper full frame position, without + /// the fractional part. + [[nodiscard]] FramePos toUpperFrameBoundary() const { + return FramePos(std::ceil(value())); + } + /// Return position rounded to the nearest full frame position, without /// the fractional part. [[nodiscard]] FramePos toNearestFrameBoundary() const { |