Merge pull request #14496 from Dentomologist/audiopane_fix_wasapi_default_device_combo_selection
AudioPane: Fix WASAPI default device combo selection
This commit is contained in:
5 files changed
+12
-5
No files matched your search
@@ -176,7 +176,7 @@ bool WASAPIStream::SetRunning(bool running)
|
|||||||
|
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
|
|
||||||
if (Config::Get(Config::MAIN_WASAPI_DEVICE) == "default")
|
if (Config::IsDefaultValue(Config::MAIN_WASAPI_DEVICE))
|
||||||
{
|
{
|
||||||
result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, &device);
|
result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, &device);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,6 +135,12 @@ void DeleteKey(LayerType layer, const Info<T>& info)
|
|||||||
OnConfigChanged();
|
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.
|
// Used to defer OnConfigChanged until after the completion of many config changes.
|
||||||
class ConfigChangeCallbackGuard
|
class ConfigChangeCallbackGuard
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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{
|
const Info<bool> MAIN_AUDIO_MUTE_ON_DISABLED_SPEED_LIMIT{
|
||||||
{System::Main, "DSP", "MuteOnDisabledSpeedLimit"}, false};
|
{System::Main, "DSP", "MuteOnDisabledSpeedLimit"}, false};
|
||||||
#ifdef _WIN32
|
#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
|
#endif
|
||||||
|
|
||||||
bool ShouldUseDPL2Decoder()
|
bool ShouldUseDPL2Decoder()
|
||||||
|
|||||||
@@ -123,8 +123,9 @@ void AudioPane::CreateWidgets()
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
std::vector<std::pair<QString, QString>> wasapi_options;
|
std::vector<std::pair<QString, QString>> wasapi_options;
|
||||||
wasapi_options.push_back(
|
const auto default_device_config_value =
|
||||||
std::pair<QString, QString>{tr("Default Device"), QStringLiteral("default")});
|
QString::fromStdString(Config::MAIN_WASAPI_DEVICE.GetDefaultValue());
|
||||||
|
wasapi_options.emplace_back(tr("Default Device"), default_device_config_value);
|
||||||
|
|
||||||
for (auto string : WASAPIStream::GetAvailableDevices())
|
for (auto string : WASAPIStream::GetAvailableDevices())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ void HandleDiscordJoin(const char* join_secret)
|
|||||||
if (event_handler == nullptr)
|
if (event_handler == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Config::Get(Config::NETPLAY_NICKNAME) == Config::NETPLAY_NICKNAME.GetDefaultValue())
|
if (Config::IsDefaultValue(Config::NETPLAY_NICKNAME))
|
||||||
Config::SetCurrent(Config::NETPLAY_NICKNAME, username);
|
Config::SetCurrent(Config::NETPLAY_NICKNAME, username);
|
||||||
|
|
||||||
std::string secret(join_secret);
|
std::string secret(join_secret);
|
||||||
|
|||||||
Reference in new issue
Block a user