summaryrefslogtreecommitdiffhomepage
path: root/UI.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2025-01-03 23:43:56 +0100
committerRoland Reichwein <mail@reichwein.it>2025-01-03 23:43:56 +0100
commit0399f008b22482c46d37fa15e6be205b85681011 (patch)
tree003060dce02839a145cf2e798d1a14e352faf212 /UI.cpp
parent22cdfccb11679d6ae241653c9cb92c32f4fc1fde (diff)
Buffer position compensation for PCM, added active sensing detection
Diffstat (limited to 'UI.cpp')
-rw-r--r--UI.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/UI.cpp b/UI.cpp
index 8baf4db..c083d53 100644
--- a/UI.cpp
+++ b/UI.cpp
@@ -12,7 +12,7 @@
using namespace std::chrono_literals;
-UI::UI(): m_main_loops{}, m_main_loops_checkpoint{}, m_main_loops_timestamp{}
+UI::UI(): m_main_loops{}, m_main_loops_checkpoint{}, m_main_loops_timestamp{}, m_active_sensing_timestamp{}
{
}
@@ -35,14 +35,16 @@ void UI::draw()
std::vector<int> cpuloads = get_cpu_loads();
int main_loops_per_second = get_main_loops_per_second();
+ bool active_sensing_detected = (clock_type::now() - m_active_sensing_timestamp) < 2s;
+
// clear screen
std::cout << "\x1B[2J\x1B[H";
- std::cout << std::endl;
+ //std::cout << std::endl;
+
std::cout << "- -- BPM +" << std::endl;
std::cout << "Mode: Click __/__ (Clock Internal)" << std::endl;
std::cout << std::endl;
std::cout << "Status:" << std::endl;
- std::cout << " Alive/not alive" << std::endl;
std::cout << " CPU:";
for (auto& i: cpuloads) {
@@ -53,9 +55,10 @@ void UI::draw()
std::cout << " Notes/Channels: -- -- -- ... (Choose)" << std::endl;
std::cout << " Timestamp: ------" << std::endl;
- std::cout << " Active sensing: ---" << std::endl;
+ std::cout << fmt::format(" Active sensing: {}", active_sensing_detected) << std::endl;
std::cout << " Clock: ____ BPM" << std::endl;
std::cout << " Click: ____ BPM" << std::endl;
+ std::cout << " Internal: ____ BPM" << std::endl;
std::cout << fmt::format(" Main loops/s: {}", main_loops_per_second) << std::endl;
@@ -69,3 +72,7 @@ void UI::count_main_loops()
debug_cout << "DEBUG:" << m_main_loops << std::endl;
}
+void UI::slot_active_sensing()
+{
+ m_active_sensing_timestamp = clock_type::now();
+}