diff options
author | Jan Holthuis <jholthuis@mixxx.org> | 2021-07-01 22:12:36 +0200 |
---|---|---|
committer | Jan Holthuis <jholthuis@mixxx.org> | 2021-07-01 22:12:36 +0200 |
commit | f808edb3a2ac9408458152ffa9264c274fdc2580 (patch) | |
tree | b1076905fd5420ef0bba592a1f47a6c77da7e756 /src/audio | |
parent | 69c37175c2b424e5af2da76827babd208f20367c (diff) |
Frame: Add constexpr to some methods
Diffstat (limited to 'src/audio')
-rw-r--r-- | src/audio/frame.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/audio/frame.h b/src/audio/frame.h index 2a18f39845..1427966bd1 100644 --- a/src/audio/frame.h +++ b/src/audio/frame.h @@ -28,11 +28,11 @@ class FramePos final { : m_framePosition(framePosition) { } - static FramePos fromEngineSamplePos(double engineSamplePos) { + static constexpr FramePos fromEngineSamplePos(double engineSamplePos) { return FramePos(engineSamplePos / mixxx::kEngineChannelCount); } - double toEngineSamplePos() const { + constexpr double toEngineSamplePos() const { return value() * mixxx::kEngineChannelCount; } @@ -44,7 +44,7 @@ class FramePos final { m_framePosition = framePosition; } - value_t value() const { + constexpr value_t value() const { return m_framePosition; } |