From 1954136b52376783758f7cecc5e417d8634283fd Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 29 Jan 2024 15:28:13 +0100 Subject: [PATCH] tweak audio device names, dont bother with api prefixes Signed-off-by: falkTX --- src/systray/mod-desktop-app.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/systray/mod-desktop-app.hpp b/src/systray/mod-desktop-app.hpp index 73b8c74..bdd0481 100644 --- a/src/systray/mod-desktop-app.hpp +++ b/src/systray/mod-desktop-app.hpp @@ -514,7 +514,7 @@ class AppWindow : public QMainWindow const PaDeviceInfo* const devInfo = Pa_GetDeviceInfo(i); const QString& hostApiName(apis[devInfo->hostApi]); - const QString devName(QString::fromUtf8(devInfo->name)); + QString devName(QString::fromUtf8(devInfo->name)); #if defined(Q_OS_LINUX) if (hostApiName == "ALSA") @@ -542,16 +542,21 @@ class AppWindow : public QMainWindow const QString uid(hostApiName + "::" + devName); + if (hostApiName == "JACK" || hostApiName == "JACK Audio Connection Kit") + devName = "JACK / PipeWire"; + else if (hostApiName != "ALSA" && hostApiName != "Windows WASAPI") + devName = uid; + if (devInfo->maxInputChannels > 0 && canUseSeparateInput) { - ui.cb_input->addItem(uid); + ui.cb_input->addItem(devName); inputs.append(uid); } if (devInfo->maxOutputChannels > 0) { - ui.cb_device->addItem(hostApiName == "JACK" || hostApiName == "JACK Audio Connection Kit" - ? "JACK / PipeWire" : uid); + ui.cb_device->addItem(devName); + devices.append({ uid, devInfo->maxInputChannels > 0,