aboutsummaryrefslogtreecommitdiffstats
path: root/source/device.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2021-08-08 22:50:12 -0400
committerClyne Sullivan <clyne@bitgloo.com>2021-08-08 22:50:12 -0400
commit3da3e76f17912e1105c090b738edc1cf2a8ad861 (patch)
treece97d33dd8a34193564f3b4c81448243d6996341 /source/device.cpp
parentbf0a126e8a9d30b77007829166f4bf91a3900079 (diff)
swap status bar for log view
Diffstat (limited to 'source/device.cpp')
-rw-r--r--source/device.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/device.cpp b/source/device.cpp
index 1dcacf0..cb4ee0a 100644
--- a/source/device.cpp
+++ b/source/device.cpp
@@ -14,7 +14,7 @@
#include "imgui.h"
extern stmdsp::device *m_device;
-extern std::string statusMessage;
+extern void log(const std::string& str);
static const char *sampleRateList[6] = {
"8 kHz",
@@ -91,35 +91,35 @@ void deviceConnect()
m_device = new stmdsp::device(devices.front());
if (m_device->connected()) {
sampleRatePreview = sampleRateList[m_device->get_sample_rate()];
- statusMessage = "Connected!";
+ log("Connected!");
} else {
delete m_device;
m_device = nullptr;
- statusMessage = "Failed to connect.";
+ log("Failed to connect.");
}
} else {
- statusMessage = "No devices found.";
+ log("No devices found.");
}
} else {
delete m_device;
m_device = nullptr;
- statusMessage = "Disconnected.";
+ log("Disconnected.");
}
}
void deviceStart()
{
if (m_device == nullptr) {
- statusMessage = "No device connected.";
+ log("No device connected.");
return;
}
if (m_device->is_running()) {
m_device->continuous_stop();
- statusMessage = "Ready.";
+ log("Ready.");
} else {
m_device->continuous_start();
- statusMessage = "Running.";
+ log("Running.");
}
}