From 39ec820c931b07bc0cec98add36f106a5965e137 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 4 Jan 2025 13:48:34 +0100 Subject: BPM detect --- BPMDetect.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 BPMDetect.h (limited to 'BPMDetect.h') diff --git a/BPMDetect.h b/BPMDetect.h new file mode 100644 index 0000000..7cd926e --- /dev/null +++ b/BPMDetect.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +#include +#include + +class BPMDetect +{ +public: + BPMDetect(int divider); + void receive_event(); + + // signal + boost::signals2::signal signal_bpm; + +private: + using clock_type = std::chrono::high_resolution_clock; + using time_point = std::chrono::time_point; + + const int m_divider; + + int m_count; + + std::deque m_timestamps; +}; + -- cgit v1.2.3