From 39a1759601871230806fbd45d1567b8f7cbb34de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maksymilian=20Wilczy=C5=84ski?= Date: Tue, 13 May 2025 19:35:30 +0200 Subject: [PATCH] no more unicode, it can actually end with enter --- main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 85572b6..b3718ec 100644 --- a/main.cpp +++ b/main.cpp @@ -106,7 +106,7 @@ void ShowActiveInstruments(HSTREAM stream) { const char* name = gm_instruments[prog]; std::cout << "> [Ch " << std::setw(2) << std::setfill(' ') << (ch + 1) - << "] 🎶 " << name << " (Bank " << bank << ", Prog " << prog << ")\n"; + << "] " << name << " (Bank " << bank << ", Prog " << prog << ")\n"; } } @@ -180,9 +180,10 @@ int main(int argc, char** argv) { return 1; } + bool shouldPlay = true; std::thread monitorThread([&]() { const int linesPerUpdate = 18; // 16 channels + header/footer - while (BASS_ChannelIsActive(midiStream) == BASS_ACTIVE_PLAYING) { + while (BASS_ChannelIsActive(midiStream) == BASS_ACTIVE_PLAYING && shouldPlay) { std::this_thread::sleep_for(std::chrono::seconds(1)); ClearLines(linesPerUpdate); std::cout << "--- Active Instruments ---\n"; @@ -194,7 +195,9 @@ int main(int argc, char** argv) { std::cout << "Press Enter to stop...\n"; std::cin.get(); // wait for user input + shouldPlay = false; monitorThread.join(); + std::cout << "Playing end.\n"; } else { std::ofstream wav("output.wav", std::ios::binary); if (!wav) {