diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2026-03-23 15:27:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-23 15:27:29 -0500 |
| commit | c05b231015375a88ecb4c4eea69862c8c75b809c (patch) | |
| tree | 01e2bae15516053486dea1078220ccfb672286a1 /Source/Core | |
| parent | cddffd2e2a40a00ad1da6821e98e9a06bf02d97d (diff) | |
| parent | 6b2a8eff15bffc1dc6831d236032c751f426eb13 (diff) | |
Merge pull request #14496 from Dentomologist/audiopane_fix_wasapi_default_device_combo_selection
AudioPane: Fix WASAPI default device combo selection
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/AudioCommon/WASAPIStream.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Common/Config/Config.h | 6 | ||||
| -rw-r--r-- | Source/Core/Core/Config/MainSettings.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Settings/AudioPane.cpp | 5 | ||||
| -rw-r--r-- | Source/Core/UICommon/DiscordPresence.cpp | 2 |
5 files changed, 12 insertions, 5 deletions
diff --git a/Source/Core/AudioCommon/WASAPIStream.cpp b/Source/Core/AudioCommon/WASAPIStream.cpp index afd5531ae8..9cbf915e82 100644 --- a/Source/Core/AudioCommon/WASAPIStream.cpp +++ b/Source/Core/AudioCommon/WASAPIStream.cpp @@ -176,7 +176,7 @@ bool WASAPIStream::SetRunning(bool running) HRESULT result; - if (Config::Get(Config::MAIN_WASAPI_DEVICE) == "default") + if (Config::IsDefaultValue(Config::MAIN_WASAPI_DEVICE)) { result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, &device); } diff --git a/Source/Core/Common/Config/Config.h b/Source/Core/Common/Config/Config.h index d8a2a9a691..b749986f7e 100644 --- a/Source/Core/Common/Config/Config.h +++ b/Source/Core/Common/Config/Config.h @@ -135,6 +135,12 @@ void DeleteKey(LayerType layer, const Info<T>& info) OnConfigChanged(); } +template <typename T> +bool IsDefaultValue(const Info<T>& info) +{ + return Get(info) == info.GetDefaultValue(); +} + // Used to defer OnConfigChanged until after the completion of many config changes. class ConfigChangeCallbackGuard { diff --git a/Source/Core/Core/Config/MainSettings.cpp b/Source/Core/Core/Config/MainSettings.cpp index 3d46d756bf..147aeedf50 100644 --- a/Source/Core/Core/Config/MainSettings.cpp +++ b/Source/Core/Core/Config/MainSettings.cpp @@ -319,7 +319,7 @@ const Info<bool> MAIN_AUDIO_MUTED{{System::Main, "DSP", "Muted"}, false}; const Info<bool> MAIN_AUDIO_MUTE_ON_DISABLED_SPEED_LIMIT{ {System::Main, "DSP", "MuteOnDisabledSpeedLimit"}, false}; #ifdef _WIN32 -const Info<std::string> MAIN_WASAPI_DEVICE{{System::Main, "DSP", "WASAPIDevice"}, "Default"}; +const Info<std::string> MAIN_WASAPI_DEVICE{{System::Main, "DSP", "WASAPIDevice"}, "default"}; #endif bool ShouldUseDPL2Decoder() diff --git a/Source/Core/DolphinQt/Settings/AudioPane.cpp b/Source/Core/DolphinQt/Settings/AudioPane.cpp index 435e8f24d5..e48faa7c01 100644 --- a/Source/Core/DolphinQt/Settings/AudioPane.cpp +++ b/Source/Core/DolphinQt/Settings/AudioPane.cpp @@ -123,8 +123,9 @@ void AudioPane::CreateWidgets() #ifdef _WIN32 std::vector<std::pair<QString, QString>> wasapi_options; - wasapi_options.push_back( - std::pair<QString, QString>{tr("Default Device"), QStringLiteral("default")}); + const auto default_device_config_value = + QString::fromStdString(Config::MAIN_WASAPI_DEVICE.GetDefaultValue()); + wasapi_options.emplace_back(tr("Default Device"), default_device_config_value); for (auto string : WASAPIStream::GetAvailableDevices()) { diff --git a/Source/Core/UICommon/DiscordPresence.cpp b/Source/Core/UICommon/DiscordPresence.cpp index 80436f6439..1be073a4ca 100644 --- a/Source/Core/UICommon/DiscordPresence.cpp +++ b/Source/Core/UICommon/DiscordPresence.cpp @@ -55,7 +55,7 @@ void HandleDiscordJoin(const char* join_secret) if (event_handler == nullptr) return; - if (Config::Get(Config::NETPLAY_NICKNAME) == Config::NETPLAY_NICKNAME.GetDefaultValue()) + if (Config::IsDefaultValue(Config::NETPLAY_NICKNAME)) Config::SetCurrent(Config::NETPLAY_NICKNAME, username); std::string secret(join_secret); |
