#pragma once #include "tools/music.h" #include #include class BPMCalculator { public: explicit BPMCalculator(const std::shared_ptr& music); void setMusic(const std::shared_ptr& music); void start(); void click(); int getCurrentApproximation() const; private: std::shared_ptr _music; std::vector _deltas; microsec _previous_click_offset; };