From 27329e8998aefdcf168d8753dcd0babe96557df3 Mon Sep 17 00:00:00 2001 From: Vektor Date: Tue, 15 Aug 2023 15:55:00 +0200 Subject: [PATCH] revert --- examples/devicetests.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/examples/devicetests.cpp b/examples/devicetests.cpp index e1f040b..81c2b5a 100644 --- a/examples/devicetests.cpp +++ b/examples/devicetests.cpp @@ -67,26 +67,20 @@ int main() for(;;) { - std::string cmd; - std::cin >> cmd; + int nextDeviceIndex = 0; + std::cin >> nextDeviceIndex; - if(cmd == "devices") + if (nextDeviceIndex < inputDevices.size()) { - numDevices = soundInput->GetNumDevices(); - printf("number of input devices: %d\n", numDevices); - - for (int i = 0; i < numDevices; i++) + auto err = soundInput->SelectDeviceByUID(inputDevices[nextDeviceIndex].c_str()); + if (err != AltVoiceError::Ok) { - const int deviceId = soundInput->GetDeviceIdFromIndex(i); - inputDevices.push_back(soundInput->GetDeviceUID(deviceId)); - printf("%d: %s[%s]\n", i, soundInput->GetDeviceName(deviceId), soundInput->GetDeviceUID(deviceId)); + std::cout << AV_GetVoiceErrorText(err) << std::endl; + } + else + { + std::cout << soundInput->GetCurrentDeviceUID() << std::endl; } - } - else if(cmd == "device") - { - auto device = soundInput->GetCurrentDeviceUID(); - printf("current device: %s", device); - soundInput->UpdateDevice(); } } } \ No newline at end of file