1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:07:34 +00:00

LibDSP: Improve const correctness

This commit is contained in:
kleines Filmröllchen 2022-05-11 21:49:41 +02:00 committed by Linus Groh
parent 4a6ebb8beb
commit bcb331b862
8 changed files with 23 additions and 22 deletions

View file

@ -16,6 +16,7 @@ namespace LibDSP {
class Transport final : public RefCounted<Transport> {
public:
constexpr u32& time() { return m_time; }
constexpr u32 time() const { return m_time; }
constexpr u16 beats_per_minute() const { return m_beats_per_minute; }
constexpr double current_second() const { return static_cast<double>(m_time) / m_sample_rate; }
constexpr double samples_per_measure() const { return (1.0 / m_beats_per_minute) * 60.0 * m_sample_rate; }