no more unicode, it can actually end with enter
This commit is contained in:
1 parent
417362b87f
commit
39a1759601
1 file changed
+5
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user