forked from NaiJi/project-kyoku
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
468 B
C++
24 lines
468 B
C++
#pragma once
|
|
|
|
#include "tools/music.h"
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
class BPMCalculator
|
|
{
|
|
public:
|
|
explicit BPMCalculator(const std::shared_ptr<Music>& music);
|
|
void setMusic(const std::shared_ptr<Music>& music);
|
|
std::shared_ptr<Music> music() const;
|
|
|
|
void start();
|
|
|
|
void click();
|
|
int getCurrentApproximation() const;
|
|
|
|
private:
|
|
std::shared_ptr<Music> _music;
|
|
std::vector<microsec> _deltas;
|
|
microsec _previous_click_offset;
|
|
};
|