summaryrefslogtreecommitdiffhomepage
path: root/UI.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2025-01-11 11:43:58 +0100
committerRoland Reichwein <mail@reichwein.it>2025-01-11 11:43:58 +0100
commit171aa5502cfcac1abc5315c8792521790195e4a9 (patch)
tree4c8e944938501ba2ef3d0a7e0d5980d07b588221 /UI.cpp
parent3c7b85d8355c64dec5b4ce011753196d53774103 (diff)
Add notes and temperature monitor
Diffstat (limited to 'UI.cpp')
-rw-r--r--UI.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/UI.cpp b/UI.cpp
index 0b281b9..5332bba 100644
--- a/UI.cpp
+++ b/UI.cpp
@@ -58,6 +58,7 @@ UI::UI(Config& config):
m_config(config),
m_main_loops{},
m_midi_events{},
+ m_midi_notes{},
m_active_sensing_timestamp{},
m_midi_timestamp{},
m_note_bpm{},
@@ -89,6 +90,9 @@ void UI::draw()
std::vector<int> cpuloads = get_cpu_loads();
int main_loops_per_second = m_main_loops.get_count_per_second();
int midi_events_per_second = m_midi_events.get_count_per_second();
+ int midi_notes_per_second = m_midi_notes.get_count_per_second();
+
+ int temperature = m_temperature.read_degree();
int mode = m_config.get_mode();
int channel = m_config.get_midi_channel();
@@ -159,12 +163,14 @@ void UI::draw()
std::cout << std::endl;
std::cout << fmt::format(" MIDI Timestamp: {}", m_midi_timestamp) << std::endl;
std::cout << " MIDI Active Sensing: " << fmt::format(value_color, "{}", active_sensing_names[active_sensing_detected]) << std::endl;
- std::cout << fmt::format(" MIDI Events/s: {}", midi_events_per_second) << 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(" Internal: {:3} BPM", internal_bpm) << std::endl;
+ 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 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(" Internal: {:3} BPM", internal_bpm) << std::endl;
- std::cout << fmt::format(" Main loops/s: {}", main_loops_per_second) << std::endl;
+ std::cout << fmt::format(" Main loops/s: {:3}", main_loops_per_second) << std::endl;
+ std::cout << fmt::format(" Temperature: {:3} C", temperature) << std::endl;
std::cout << std::endl;
std::cout << "Log:" << std::endl;
@@ -227,6 +233,11 @@ void UI::count_midi_events()
m_midi_events.count();
}
+void UI::count_midi_notes()
+{
+ m_midi_notes.count();
+}
+
void UI::slot_active_sensing()
{
m_active_sensing_timestamp = clock_type::now();
@@ -241,6 +252,8 @@ void UI::slot_midi_note(int channel, int note, uint64_t timestamp)
while (m_midi_monitor.size() > midi_monitor_max_size) {
m_midi_monitor.pop_back();
}
+
+ count_midi_notes();
}
void UI::slot_note_bpm(int bpm)