Skip to content

Commit

Permalink
FramePos: Add method to rount to upper frame boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Jul 10, 2021
1 parent 3ef395b commit 2253c78
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/audio/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2253c78

Please sign in to comment.