diff options
author | Roland Reichwein <mail@reichwein.it> | 2025-01-11 14:59:22 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2025-01-11 14:59:22 +0100 |
commit | 445b696f43a9106f8871a67c077e990ce1ca14ab (patch) | |
tree | 4bcabf7a38db8cbd96cafc9452f84aa8ff4e11c3 /UI.cpp | |
parent | 0cb4b08d406caff8cd2081ddb09bceb74d4e3a16 (diff) |
Age out bpm data
Diffstat (limited to 'UI.cpp')
-rw-r--r-- | UI.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -68,8 +68,8 @@ UI::UI(Config& config): m_midi_notes{}, m_active_sensing_timestamp{}, m_midi_timestamp{}, - m_note_bpm{}, - m_clock_bpm{}, + m_note_bpm{2000ms}, + m_clock_bpm{2000ms}, m_touchpad{} { } @@ -108,9 +108,9 @@ void UI::draw() int internal_bpm = m_config.get_bpm(); int bpm; if (mode == 0) { - bpm = m_note_bpm; + bpm = m_note_bpm.value(); } else if (mode == 1) { - bpm = m_clock_bpm; + bpm = m_clock_bpm.value(); } else if (mode == 2) { bpm = m_config.get_bpm(); } @@ -174,8 +174,8 @@ void UI::draw() std::cout << fmt::format(" MIDI Events/s:{:3}", midi_events_per_second) << std::endl; std::cout << fmt::format(" MIDI Notes/s: {:3}", midi_notes_per_second) << std::endl; std::cout << fmt::format(" MIDI Bytes/s: {:3} ({}%)", midi_bytes_per_second, midi_bytes_per_second * 100 / midi_bandwidth) << std::endl; - std::cout << fmt::format(" MIDI Click: {:3} BPM", m_note_bpm) << std::endl; - std::cout << fmt::format(" MIDI Clock: {:3} BPM", m_clock_bpm) << std::endl; + std::cout << fmt::format(" MIDI Click: {:3} BPM", m_note_bpm.value()) << std::endl; + std::cout << fmt::format(" MIDI Clock: {:3} BPM", m_clock_bpm.value()) << std::endl; std::cout << fmt::format(" Internal: {:3} BPM", internal_bpm) << std::endl; std::cout << fmt::format(" Main loops/s: {:3}", main_loops_per_second) << std::endl; @@ -268,11 +268,11 @@ void UI::slot_midi_note(int channel, int note, uint64_t timestamp) void UI::slot_note_bpm(int bpm) { - m_note_bpm = bpm; + m_note_bpm.update(bpm); } void UI::slot_clock_bpm(int bpm) { - m_clock_bpm = bpm; + m_clock_bpm.update(bpm); } |