#pragma once #include "config.h" #include #include #include #include class UI { public: using clock_type = std::chrono::high_resolution_clock; UI(Config& config); void draw(); // signals boost::signals2::signal bpm_plus; boost::signals2::signal bpm_minus; boost::signals2::signal note_set_from_midi; boost::signals2::signal mode; // slots void count_main_loops(); void slot_active_sensing(); void slot_midi_note(int channel, int note, uint64_t timestamp); private: Config& m_config; int get_main_loops_per_second(); uint64_t m_main_loops; uint64_t m_main_loops_checkpoint; std::chrono::time_point m_main_loops_timestamp; std::chrono::time_point m_active_sensing_timestamp; uint64_t m_midi_timestamp; std::deque> m_midi_monitor; };