Port Main.DSP to MainSettings

While trying to work on adding audiodump support for CLI, I was alerted that it was important to first try moving the DSP configs to the new config before continuing, as that makes it substantially easier to write clean code to add such a feature.

This commit aims to allow for Dolphin to only rely on the new config for DSP-related settings.
This commit is contained in:
sowens99 2021-10-13 20:29:04 -04:00
parent 023eb0b702
commit 8ea6bef98f
26 changed files with 132 additions and 205 deletions

View File

@ -13,6 +13,7 @@
#include "Common/Common.h" #include "Common/Common.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
// This shouldn't be a global, at least not here. // This shouldn't be a global, at least not here.
@ -47,7 +48,7 @@ static std::unique_ptr<SoundStream> CreateSoundStreamForBackend(std::string_view
void InitSoundStream() void InitSoundStream()
{ {
std::string backend = SConfig::GetInstance().sBackend; std::string backend = Config::Get(Config::MAIN_AUDIO_BACKEND);
g_sound_stream = CreateSoundStreamForBackend(backend); g_sound_stream = CreateSoundStreamForBackend(backend);
if (!g_sound_stream) if (!g_sound_stream)
@ -73,7 +74,7 @@ void PostInitSoundStream()
UpdateSoundStream(); UpdateSoundStream();
SetSoundStreamRunning(true); SetSoundStreamRunning(true);
if (SConfig::GetInstance().m_DumpAudio && !s_audio_dump_start) if (Config::Get(Config::MAIN_DUMP_AUDIO) && !s_audio_dump_start)
StartAudioDump(); StartAudioDump();
} }
@ -81,7 +82,7 @@ void ShutdownSoundStream()
{ {
INFO_LOG_FMT(AUDIO, "Shutting down sound stream"); INFO_LOG_FMT(AUDIO, "Shutting down sound stream");
if (SConfig::GetInstance().m_DumpAudio && s_audio_dump_start) if (Config::Get(Config::MAIN_DUMP_AUDIO) && s_audio_dump_start)
StopAudioDump(); StopAudioDump();
SetSoundStreamRunning(false); SetSoundStreamRunning(false);
@ -159,7 +160,7 @@ void UpdateSoundStream()
{ {
if (g_sound_stream) if (g_sound_stream)
{ {
int volume = SConfig::GetInstance().m_IsMuted ? 0 : SConfig::GetInstance().m_Volume; int volume = Config::Get(Config::MAIN_AUDIO_MUTED) ? 0 : Config::Get(Config::MAIN_AUDIO_VOLUME);
g_sound_stream->SetVolume(volume); g_sound_stream->SetVolume(volume);
} }
} }
@ -186,9 +187,9 @@ void SendAIBuffer(const short* samples, unsigned int num_samples)
if (!g_sound_stream) if (!g_sound_stream)
return; return;
if (SConfig::GetInstance().m_DumpAudio && !s_audio_dump_start) if (Config::Get(Config::MAIN_DUMP_AUDIO) && !s_audio_dump_start)
StartAudioDump(); StartAudioDump();
else if (!SConfig::GetInstance().m_DumpAudio && s_audio_dump_start) else if (!Config::Get(Config::MAIN_DUMP_AUDIO) && s_audio_dump_start)
StopAudioDump(); StopAudioDump();
Mixer* pMixer = g_sound_stream->GetMixer(); Mixer* pMixer = g_sound_stream->GetMixer();
@ -221,28 +222,30 @@ void StopAudioDump()
void IncreaseVolume(unsigned short offset) void IncreaseVolume(unsigned short offset)
{ {
SConfig::GetInstance().m_IsMuted = false; Config::SetBaseOrCurrent(Config::MAIN_AUDIO_MUTED, false);
int& currentVolume = SConfig::GetInstance().m_Volume; int currentVolume = Config::Get(Config::MAIN_AUDIO_VOLUME);
currentVolume += offset; currentVolume += offset;
if (currentVolume > AUDIO_VOLUME_MAX) if (currentVolume > AUDIO_VOLUME_MAX)
currentVolume = AUDIO_VOLUME_MAX; currentVolume = AUDIO_VOLUME_MAX;
Config::SetBaseOrCurrent(Config::MAIN_AUDIO_VOLUME, currentVolume);
UpdateSoundStream(); UpdateSoundStream();
} }
void DecreaseVolume(unsigned short offset) void DecreaseVolume(unsigned short offset)
{ {
SConfig::GetInstance().m_IsMuted = false; Config::SetBaseOrCurrent(Config::MAIN_AUDIO_MUTED, false);
int& currentVolume = SConfig::GetInstance().m_Volume; int currentVolume = Config::Get(Config::MAIN_AUDIO_VOLUME);
currentVolume -= offset; currentVolume -= offset;
if (currentVolume < AUDIO_VOLUME_MIN) if (currentVolume < AUDIO_VOLUME_MIN)
currentVolume = AUDIO_VOLUME_MIN; currentVolume = AUDIO_VOLUME_MIN;
Config::SetBaseOrCurrent(Config::MAIN_AUDIO_VOLUME, currentVolume);
UpdateSoundStream(); UpdateSoundStream();
} }
void ToggleMuteVolume() void ToggleMuteVolume()
{ {
bool& isMuted = SConfig::GetInstance().m_IsMuted; bool isMuted = Config::Get(Config::MAIN_AUDIO_MUTED);
isMuted = !isMuted; Config::SetBaseOrCurrent(Config::MAIN_AUDIO_MUTED, !isMuted);
UpdateSoundStream(); UpdateSoundStream();
} }
} // namespace AudioCommon } // namespace AudioCommon

View File

@ -7,7 +7,7 @@
#include "AudioCommon/AudioStretcher.h" #include "AudioCommon/AudioStretcher.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Core/ConfigManager.h" #include "Core/Config/MainSettings.h"
namespace AudioCommon namespace AudioCommon
{ {
@ -31,7 +31,7 @@ void AudioStretcher::ProcessSamples(const short* in, unsigned int num_in, unsign
// We were given actual_samples number of samples, and num_samples were requested from us. // We were given actual_samples number of samples, and num_samples were requested from us.
double current_ratio = static_cast<double>(num_in) / static_cast<double>(num_out); double current_ratio = static_cast<double>(num_in) / static_cast<double>(num_out);
const double max_latency = SConfig::GetInstance().m_audio_stretch_max_latency; const double max_latency = Config::Get(Config::MAIN_AUDIO_STRETCH_LATENCY);
const double max_backlog = m_sample_rate * max_latency / 1000.0 / m_stretch_ratio; const double max_backlog = m_sample_rate * max_latency / 1000.0 / m_stretch_ratio;
const double backlog_fullness = m_sound_touch.numSamples() / max_backlog; const double backlog_fullness = m_sound_touch.numSamples() / max_backlog;
if (backlog_fullness > 5.0) if (backlog_fullness > 5.0)

View File

@ -8,7 +8,7 @@
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/Thread.h" #include "Common/Thread.h"
#include "Core/ConfigManager.h" #include "Core/Config/MainSettings.h"
// ~10 ms - needs to be at least 240 for surround // ~10 ms - needs to be at least 240 for surround
constexpr u32 BUFFER_SAMPLES = 512; constexpr u32 BUFFER_SAMPLES = 512;
@ -36,7 +36,7 @@ bool CubebStream::Init()
if (!m_ctx) if (!m_ctx)
return false; return false;
m_stereo = !SConfig::GetInstance().ShouldUseDPL2Decoder(); m_stereo = !Config::ShouldUseDPL2Decoder();
cubeb_stream_params params; cubeb_stream_params params;
params.rate = m_mixer->GetSampleRate(); params.rate = m_mixer->GetSampleRate();

View File

@ -154,7 +154,7 @@ unsigned int Mixer::Mix(short* samples, unsigned int num_samples)
memset(samples, 0, num_samples * 2 * sizeof(short)); memset(samples, 0, num_samples * 2 * sizeof(short));
if (SConfig::GetInstance().m_audio_stretch) if (Config::Get(Config::MAIN_AUDIO_STRETCH))
{ {
unsigned int available_samples = unsigned int available_samples =
std::min(m_dma_mixer.AvailableSamples(), m_streaming_mixer.AvailableSamples()); std::min(m_dma_mixer.AvailableSamples(), m_streaming_mixer.AvailableSamples());

View File

@ -12,7 +12,7 @@
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/Thread.h" #include "Common/Thread.h"
#include "Core/ConfigManager.h" #include "Core/Config/MainSettings.h"
static HMODULE s_openal_dll = nullptr; static HMODULE s_openal_dll = nullptr;
@ -212,7 +212,7 @@ void OpenALStream::SoundLoop()
bool float32_capable = palIsExtensionPresent("AL_EXT_float32") != 0; bool float32_capable = palIsExtensionPresent("AL_EXT_float32") != 0;
bool surround_capable = palIsExtensionPresent("AL_EXT_MCFORMATS") || IsCreativeXFi(); bool surround_capable = palIsExtensionPresent("AL_EXT_MCFORMATS") || IsCreativeXFi();
bool use_surround = SConfig::GetInstance().ShouldUseDPL2Decoder() && surround_capable; bool use_surround = Config::ShouldUseDPL2Decoder() && surround_capable;
// As there is no extension to check for 32-bit fixed point support // As there is no extension to check for 32-bit fixed point support
// and we know that only a X-Fi with hardware OpenAL supports it, // and we know that only a X-Fi with hardware OpenAL supports it,
@ -223,9 +223,9 @@ void OpenALStream::SoundLoop()
u32 frames_per_buffer; u32 frames_per_buffer;
// Can't have zero samples per buffer // Can't have zero samples per buffer
if (SConfig::GetInstance().iLatency > 0) if (Config::Get(Config::MAIN_AUDIO_LATENCY) > 0)
{ {
frames_per_buffer = frequency / 1000 * SConfig::GetInstance().iLatency / OAL_BUFFERS; frames_per_buffer = frequency / 1000 * Config::Get(Config::MAIN_AUDIO_LATENCY) / OAL_BUFFERS;
} }
else else
{ {

View File

@ -9,7 +9,7 @@
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/Thread.h" #include "Common/Thread.h"
#include "Core/ConfigManager.h" #include "Core/Config/MainSettings.h"
namespace namespace
{ {
@ -20,7 +20,7 @@ PulseAudio::PulseAudio() = default;
bool PulseAudio::Init() bool PulseAudio::Init()
{ {
m_stereo = !SConfig::GetInstance().ShouldUseDPL2Decoder(); m_stereo = !Config::ShouldUseDPL2Decoder();
m_channels = m_stereo ? 2 : 6; // will tell PA we use a Stereo or 5.0 channel setup m_channels = m_stereo ? 2 : 6; // will tell PA we use a Stereo or 5.0 channel setup
NOTICE_LOG_FMT(AUDIO, "PulseAudio backend using {} channels", m_channels); NOTICE_LOG_FMT(AUDIO, "PulseAudio backend using {} channels", m_channels);

View File

@ -20,7 +20,7 @@
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Common/Thread.h" #include "Common/Thread.h"
#include "Core/ConfigManager.h" #include "Core/Config/MainSettings.h"
#include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/OnScreenDisplay.h"
using Microsoft::WRL::ComPtr; using Microsoft::WRL::ComPtr;
@ -176,19 +176,19 @@ bool WASAPIStream::SetRunning(bool running)
HRESULT result; HRESULT result;
if (SConfig::GetInstance().sWASAPIDevice == "default") if (Config::Get(Config::MAIN_WASAPI_DEVICE) == "default")
{ {
result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, device.GetAddressOf()); result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, device.GetAddressOf());
} }
else else
{ {
result = S_OK; result = S_OK;
device = GetDeviceByName(SConfig::GetInstance().sWASAPIDevice); device = GetDeviceByName(Config::Get(Config::MAIN_WASAPI_DEVICE));
if (!device) if (!device)
{ {
ERROR_LOG_FMT(AUDIO, "Can't find device '{}', falling back to default", ERROR_LOG_FMT(AUDIO, "Can't find device '{}', falling back to default",
SConfig::GetInstance().sWASAPIDevice); Config::Get(Config::MAIN_WASAPI_DEVICE));
result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, device.GetAddressOf()); result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, device.GetAddressOf());
} }
} }
@ -222,7 +222,7 @@ bool WASAPIStream::SetRunning(bool running)
result = audio_client->GetDevicePeriod(nullptr, &device_period); result = audio_client->GetDevicePeriod(nullptr, &device_period);
device_period += SConfig::GetInstance().iLatency * (10000 / m_format.Format.nChannels); device_period += Config::Get(Config::MAIN_AUDIO_LATENCY) * (10000 / m_format.Format.nChannels);
INFO_LOG_FMT(AUDIO, "Audio period set to {}", device_period); INFO_LOG_FMT(AUDIO, "Audio period set to {}", device_period);
if (!HandleWinAPI("Failed to obtain device period", result)) if (!HandleWinAPI("Failed to obtain device period", result))
@ -258,7 +258,7 @@ bool WASAPIStream::SetRunning(bool running)
device_period = device_period =
static_cast<REFERENCE_TIME>( static_cast<REFERENCE_TIME>(
10000.0 * 1000 * m_frames_in_buffer / m_format.Format.nSamplesPerSec + 0.5) + 10000.0 * 1000 * m_frames_in_buffer / m_format.Format.nSamplesPerSec + 0.5) +
SConfig::GetInstance().iLatency * 10000; Config::Get(Config::MAIN_AUDIO_LATENCY) * 10000;
result = audio_client->Initialize( result = audio_client->Initialize(
AUDCLNT_SHAREMODE_EXCLUSIVE, AUDCLNT_SHAREMODE_EXCLUSIVE,
@ -333,13 +333,13 @@ void WASAPIStream::SoundLoop()
s16* audio_data = reinterpret_cast<s16*>(data); s16* audio_data = reinterpret_cast<s16*>(data);
GetMixer()->Mix(audio_data, m_frames_in_buffer); GetMixer()->Mix(audio_data, m_frames_in_buffer);
const SConfig& config = SConfig::GetInstance(); const bool is_muted =
const bool is_muted = config.m_IsMuted || config.m_Volume == 0; Config::Get(Config::MAIN_AUDIO_MUTED) || Config::Get(Config::MAIN_AUDIO_VOLUME) == 0;
const bool need_volume_adjustment = config.m_Volume != 100 && !is_muted; const bool need_volume_adjustment = Config::Get(Config::MAIN_AUDIO_VOLUME) != 100 && !is_muted;
if (need_volume_adjustment) if (need_volume_adjustment)
{ {
const float volume = config.m_Volume / 100.0f; const float volume = Config::Get(Config::MAIN_AUDIO_VOLUME) / 100.0f;
for (u32 i = 0; i < m_frames_in_buffer * 2; i++) for (u32 i = 0; i < m_frames_in_buffer * 2; i++)
*audio_data++ *= volume; *audio_data++ *= volume;

View File

@ -12,6 +12,7 @@
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Common/Swap.h" #include "Common/Swap.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
constexpr size_t WaveFileWriter::BUFFER_SIZE; constexpr size_t WaveFileWriter::BUFFER_SIZE;
@ -30,7 +31,7 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa
// Ask to delete file // Ask to delete file
if (File::Exists(filename)) if (File::Exists(filename))
{ {
if (SConfig::GetInstance().m_DumpAudioSilent || if (Config::Get(Config::MAIN_DUMP_AUDIO_SILENT) ||
AskYesNoFmtT("Delete the existing file '{0}'?", filename)) AskYesNoFmtT("Delete the existing file '{0}'?", filename))
{ {
File::Delete(filename); File::Delete(filename);

View File

@ -82,22 +82,18 @@ private:
bool bMMU = false; bool bMMU = false;
bool bLowDCBZHack = false; bool bLowDCBZHack = false;
bool bDisableICache = false; bool bDisableICache = false;
bool m_EnableJIT = false;
bool bSyncGPU = false; bool bSyncGPU = false;
int iSyncGpuMaxDistance = 0; int iSyncGpuMaxDistance = 0;
int iSyncGpuMinDistance = 0; int iSyncGpuMinDistance = 0;
float fSyncGpuOverclock = 0; float fSyncGpuOverclock = 0;
bool bFastDiscSpeed = false; bool bFastDiscSpeed = false;
bool bDSPHLE = false;
bool bHLE_BS2 = false; bool bHLE_BS2 = false;
int iSelectedLanguage = 0; int iSelectedLanguage = 0;
PowerPC::CPUCore cpu_core = PowerPC::CPUCore::Interpreter; PowerPC::CPUCore cpu_core = PowerPC::CPUCore::Interpreter;
int Volume = 0;
float m_EmulationSpeed = 0; float m_EmulationSpeed = 0;
float m_OCFactor = 0; float m_OCFactor = 0;
bool m_OCEnable = false; bool m_OCEnable = false;
bool m_bt_passthrough_enabled = false; bool m_bt_passthrough_enabled = false;
std::string sBackend;
std::string m_strGPUDeterminismMode; std::string m_strGPUDeterminismMode;
std::array<WiimoteSource, MAX_BBMOTES> iWiimoteSource{}; std::array<WiimoteSource, MAX_BBMOTES> iWiimoteSource{};
std::array<SerialInterface::SIDevices, SerialInterface::MAX_SI_CHANNELS> Pads{}; std::array<SerialInterface::SIDevices, SerialInterface::MAX_SI_CHANNELS> Pads{};
@ -117,19 +113,15 @@ void ConfigCache::SaveConfig(const SConfig& config)
bAccurateNaNs = config.bAccurateNaNs; bAccurateNaNs = config.bAccurateNaNs;
bDisableICache = config.bDisableICache; bDisableICache = config.bDisableICache;
bMMU = config.bMMU; bMMU = config.bMMU;
m_EnableJIT = config.m_DSPEnableJIT;
bSyncGPU = config.bSyncGPU; bSyncGPU = config.bSyncGPU;
iSyncGpuMaxDistance = config.iSyncGpuMaxDistance; iSyncGpuMaxDistance = config.iSyncGpuMaxDistance;
iSyncGpuMinDistance = config.iSyncGpuMinDistance; iSyncGpuMinDistance = config.iSyncGpuMinDistance;
fSyncGpuOverclock = config.fSyncGpuOverclock; fSyncGpuOverclock = config.fSyncGpuOverclock;
bFastDiscSpeed = config.bFastDiscSpeed; bFastDiscSpeed = config.bFastDiscSpeed;
bDSPHLE = config.bDSPHLE;
bHLE_BS2 = config.bHLE_BS2; bHLE_BS2 = config.bHLE_BS2;
iSelectedLanguage = config.SelectedLanguage; iSelectedLanguage = config.SelectedLanguage;
cpu_core = config.cpu_core; cpu_core = config.cpu_core;
Volume = config.m_Volume;
m_EmulationSpeed = config.m_EmulationSpeed; m_EmulationSpeed = config.m_EmulationSpeed;
sBackend = config.sBackend;
m_strGPUDeterminismMode = config.m_strGPUDeterminismMode; m_strGPUDeterminismMode = config.m_strGPUDeterminismMode;
m_OCFactor = config.m_OCFactor; m_OCFactor = config.m_OCFactor;
m_OCEnable = config.m_OCEnable; m_OCEnable = config.m_OCEnable;
@ -165,22 +157,17 @@ void ConfigCache::RestoreConfig(SConfig* config)
config->bDisableICache = bDisableICache; config->bDisableICache = bDisableICache;
config->bMMU = bMMU; config->bMMU = bMMU;
config->bLowDCBZHack = bLowDCBZHack; config->bLowDCBZHack = bLowDCBZHack;
config->m_DSPEnableJIT = m_EnableJIT;
config->bSyncGPU = bSyncGPU; config->bSyncGPU = bSyncGPU;
config->iSyncGpuMaxDistance = iSyncGpuMaxDistance; config->iSyncGpuMaxDistance = iSyncGpuMaxDistance;
config->iSyncGpuMinDistance = iSyncGpuMinDistance; config->iSyncGpuMinDistance = iSyncGpuMinDistance;
config->fSyncGpuOverclock = fSyncGpuOverclock; config->fSyncGpuOverclock = fSyncGpuOverclock;
config->bFastDiscSpeed = bFastDiscSpeed; config->bFastDiscSpeed = bFastDiscSpeed;
config->bDSPHLE = bDSPHLE;
config->bHLE_BS2 = bHLE_BS2; config->bHLE_BS2 = bHLE_BS2;
config->SelectedLanguage = iSelectedLanguage; config->SelectedLanguage = iSelectedLanguage;
config->cpu_core = cpu_core; config->cpu_core = cpu_core;
// Only change these back if they were actually set by game ini, since they can be changed while a // Only change these back if they were actually set by game ini, since they can be changed while a
// game is running. // game is running.
if (bSetVolume)
config->m_Volume = Volume;
if (config->bWii) if (config->bWii)
{ {
for (unsigned int i = 0; i < MAX_BBMOTES; ++i) for (unsigned int i = 0; i < MAX_BBMOTES; ++i)
@ -205,7 +192,6 @@ void ConfigCache::RestoreConfig(SConfig* config)
config->m_EXIDevice[i] = m_EXIDevice[i]; config->m_EXIDevice[i] = m_EXIDevice[i];
} }
config->sBackend = sBackend;
config->m_strGPUDeterminismMode = m_strGPUDeterminismMode; config->m_strGPUDeterminismMode = m_strGPUDeterminismMode;
config->m_OCFactor = m_OCFactor; config->m_OCFactor = m_OCFactor;
config->m_OCEnable = m_OCEnable; config->m_OCEnable = m_OCEnable;
@ -255,7 +241,6 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
// General settings // General settings
IniFile::Section* core_section = game_ini.GetOrCreateSection("Core"); IniFile::Section* core_section = game_ini.GetOrCreateSection("Core");
IniFile::Section* dsp_section = game_ini.GetOrCreateSection("DSP");
IniFile::Section* controls_section = game_ini.GetOrCreateSection("Controls"); IniFile::Section* controls_section = game_ini.GetOrCreateSection("Controls");
core_section->Get("CPUThread", &StartUp.bCPUThread, StartUp.bCPUThread); core_section->Get("CPUThread", &StartUp.bCPUThread, StartUp.bCPUThread);
@ -272,17 +257,12 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
core_section->Get("LowDCBZHack", &StartUp.bLowDCBZHack, StartUp.bLowDCBZHack); core_section->Get("LowDCBZHack", &StartUp.bLowDCBZHack, StartUp.bLowDCBZHack);
core_section->Get("SyncGPU", &StartUp.bSyncGPU, StartUp.bSyncGPU); core_section->Get("SyncGPU", &StartUp.bSyncGPU, StartUp.bSyncGPU);
core_section->Get("FastDiscSpeed", &StartUp.bFastDiscSpeed, StartUp.bFastDiscSpeed); core_section->Get("FastDiscSpeed", &StartUp.bFastDiscSpeed, StartUp.bFastDiscSpeed);
core_section->Get("DSPHLE", &StartUp.bDSPHLE, StartUp.bDSPHLE);
core_section->Get("CPUCore", &StartUp.cpu_core, StartUp.cpu_core); core_section->Get("CPUCore", &StartUp.cpu_core, StartUp.cpu_core);
core_section->Get("HLE_BS2", &StartUp.bHLE_BS2, StartUp.bHLE_BS2); core_section->Get("HLE_BS2", &StartUp.bHLE_BS2, StartUp.bHLE_BS2);
core_section->Get("GameCubeLanguage", &StartUp.SelectedLanguage, StartUp.SelectedLanguage); core_section->Get("GameCubeLanguage", &StartUp.SelectedLanguage, StartUp.SelectedLanguage);
if (core_section->Get("EmulationSpeed", &StartUp.m_EmulationSpeed, StartUp.m_EmulationSpeed)) if (core_section->Get("EmulationSpeed", &StartUp.m_EmulationSpeed, StartUp.m_EmulationSpeed))
config_cache.bSetEmulationSpeed = true; config_cache.bSetEmulationSpeed = true;
if (dsp_section->Get("Volume", &StartUp.m_Volume, StartUp.m_Volume))
config_cache.bSetVolume = true;
dsp_section->Get("EnableJIT", &StartUp.m_DSPEnableJIT, StartUp.m_DSPEnableJIT);
dsp_section->Get("Backend", &StartUp.sBackend, StartUp.sBackend);
core_section->Get("GPUDeterminismMode", &StartUp.m_strGPUDeterminismMode, core_section->Get("GPUDeterminismMode", &StartUp.m_strGPUDeterminismMode,
StartUp.m_strGPUDeterminismMode); StartUp.m_strGPUDeterminismMode);
core_section->Get("Overclock", &StartUp.m_OCFactor, StartUp.m_OCFactor); core_section->Get("Overclock", &StartUp.m_OCFactor, StartUp.m_OCFactor);
@ -334,7 +314,6 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
// TODO: remove this once ConfigManager starts using OnionConfig. // TODO: remove this once ConfigManager starts using OnionConfig.
StartUp.bCPUThread = Config::Get(Config::MAIN_CPU_THREAD); StartUp.bCPUThread = Config::Get(Config::MAIN_CPU_THREAD);
StartUp.bJITFollowBranch = Config::Get(Config::MAIN_JIT_FOLLOW_BRANCH); StartUp.bJITFollowBranch = Config::Get(Config::MAIN_JIT_FOLLOW_BRANCH);
StartUp.bDSPHLE = Config::Get(Config::MAIN_DSP_HLE);
StartUp.bFastDiscSpeed = Config::Get(Config::MAIN_FAST_DISC_SPEED); StartUp.bFastDiscSpeed = Config::Get(Config::MAIN_FAST_DISC_SPEED);
StartUp.cpu_core = Config::Get(Config::MAIN_CPU_CORE); StartUp.cpu_core = Config::Get(Config::MAIN_CPU_CORE);
StartUp.bSyncGPU = Config::Get(Config::MAIN_SYNC_GPU); StartUp.bSyncGPU = Config::Get(Config::MAIN_SYNC_GPU);
@ -361,12 +340,10 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
const NetPlay::NetSettings& netplay_settings = NetPlay::GetNetSettings(); const NetPlay::NetSettings& netplay_settings = NetPlay::GetNetSettings();
Config::AddLayer(ConfigLoaders::GenerateNetPlayConfigLoader(netplay_settings)); Config::AddLayer(ConfigLoaders::GenerateNetPlayConfigLoader(netplay_settings));
StartUp.bCPUThread = netplay_settings.m_CPUthread; StartUp.bCPUThread = netplay_settings.m_CPUthread;
StartUp.bDSPHLE = netplay_settings.m_DSPHLE;
StartUp.bCopyWiiSaveNetplay = netplay_settings.m_CopyWiiSave; StartUp.bCopyWiiSaveNetplay = netplay_settings.m_CopyWiiSave;
StartUp.cpu_core = netplay_settings.m_CPUcore; StartUp.cpu_core = netplay_settings.m_CPUcore;
StartUp.SelectedLanguage = netplay_settings.m_SelectedLanguage; StartUp.SelectedLanguage = netplay_settings.m_SelectedLanguage;
StartUp.bOverrideRegionSettings = netplay_settings.m_OverrideRegionSettings; StartUp.bOverrideRegionSettings = netplay_settings.m_OverrideRegionSettings;
StartUp.m_DSPEnableJIT = netplay_settings.m_DSPEnableJIT;
StartUp.m_OCEnable = netplay_settings.m_OCEnable; StartUp.m_OCEnable = netplay_settings.m_OCEnable;
StartUp.m_OCFactor = netplay_settings.m_OCFactor; StartUp.m_OCFactor = netplay_settings.m_OCFactor;
StartUp.m_EXIDevice[0] = netplay_settings.m_EXIDevice[0]; StartUp.m_EXIDevice[0] = netplay_settings.m_EXIDevice[0];

View File

@ -131,6 +131,7 @@ const Info<bool> MAIN_DISABLE_SCREENSAVER{{System::Main, "Display", "DisableScre
// Main.DSP // Main.DSP
const Info<bool> MAIN_DSP_THREAD{{System::Main, "DSP", "DSPThread"}, false};
const Info<bool> MAIN_DSP_CAPTURE_LOG{{System::Main, "DSP", "CaptureLog"}, false}; const Info<bool> MAIN_DSP_CAPTURE_LOG{{System::Main, "DSP", "CaptureLog"}, false};
const Info<bool> MAIN_DSP_JIT{{System::Main, "DSP", "EnableJIT"}, true}; const Info<bool> MAIN_DSP_JIT{{System::Main, "DSP", "EnableJIT"}, true};
const Info<bool> MAIN_DUMP_AUDIO{{System::Main, "DSP", "DumpAudio"}, false}; const Info<bool> MAIN_DUMP_AUDIO{{System::Main, "DSP", "DumpAudio"}, false};
@ -139,6 +140,15 @@ const Info<bool> MAIN_DUMP_UCODE{{System::Main, "DSP", "DumpUCode"}, false};
const Info<std::string> MAIN_AUDIO_BACKEND{{System::Main, "DSP", "Backend"}, const Info<std::string> MAIN_AUDIO_BACKEND{{System::Main, "DSP", "Backend"},
AudioCommon::GetDefaultSoundBackend()}; AudioCommon::GetDefaultSoundBackend()};
const Info<int> MAIN_AUDIO_VOLUME{{System::Main, "DSP", "Volume"}, 100}; const Info<int> MAIN_AUDIO_VOLUME{{System::Main, "DSP", "Volume"}, 100};
const Info<bool> MAIN_AUDIO_MUTED{{System::Main, "DSP", "Muted"}, false};
#ifdef _WIN32
const Info<std::string> MAIN_WASAPI_DEVICE{{System::Main, "DSP", "WASAPIDevice"}, "Default"};
#endif
bool ShouldUseDPL2Decoder()
{
return Get(MAIN_DPL2_DECODER) && !Get(MAIN_DSP_HLE);
}
// Main.General // Main.General

View File

@ -6,9 +6,19 @@
#include <array> #include <array>
#include <string> #include <string>
#include "Common/Common.h"
#include "Common/Config/Config.h" #include "Common/Config/Config.h"
#include "DiscIO/Enums.h" #include "DiscIO/Enums.h"
// DSP Backend Types
#define BACKEND_NULLSOUND _trans("No Audio Output")
#define BACKEND_ALSA "ALSA"
#define BACKEND_CUBEB "Cubeb"
#define BACKEND_OPENAL "OpenAL"
#define BACKEND_PULSEAUDIO "Pulse"
#define BACKEND_OPENSLES "OpenSLES"
#define BACKEND_WASAPI _trans("WASAPI (Exclusive Mode)")
namespace PowerPC namespace PowerPC
{ {
enum class CPUCore; enum class CPUCore;
@ -93,6 +103,7 @@ extern const Info<bool> MAIN_REAL_WII_REMOTE_REPEAT_REPORTS;
// Main.DSP // Main.DSP
extern const Info<bool> MAIN_DSP_THREAD;
extern const Info<bool> MAIN_DSP_CAPTURE_LOG; extern const Info<bool> MAIN_DSP_CAPTURE_LOG;
extern const Info<bool> MAIN_DSP_JIT; extern const Info<bool> MAIN_DSP_JIT;
extern const Info<bool> MAIN_DUMP_AUDIO; extern const Info<bool> MAIN_DUMP_AUDIO;
@ -100,6 +111,12 @@ extern const Info<bool> MAIN_DUMP_AUDIO_SILENT;
extern const Info<bool> MAIN_DUMP_UCODE; extern const Info<bool> MAIN_DUMP_UCODE;
extern const Info<std::string> MAIN_AUDIO_BACKEND; extern const Info<std::string> MAIN_AUDIO_BACKEND;
extern const Info<int> MAIN_AUDIO_VOLUME; extern const Info<int> MAIN_AUDIO_VOLUME;
extern const Info<bool> MAIN_AUDIO_MUTED;
#ifdef _WIN32
extern const Info<std::string> MAIN_WASAPI_DEVICE;
#endif
bool ShouldUseDPL2Decoder();
// Main.Display // Main.Display

View File

@ -25,8 +25,8 @@ bool IsSettingSaveable(const Config::Location& config_location)
if (config_location.system == Config::System::Main) if (config_location.system == Config::System::Main)
{ {
for (const std::string_view section : for (const std::string_view section : {"NetPlay", "General", "GBA", "Display", "Network",
{"NetPlay", "General", "GBA", "Display", "Network", "Analytics", "AndroidOverlayButtons"}) "Analytics", "AndroidOverlayButtons", "DSP"})
{ {
if (config_location.section == section) if (config_location.section == section)
return true; return true;
@ -57,6 +57,9 @@ bool IsSettingSaveable(const Config::Location& config_location)
&Config::MAIN_ALLOW_SD_WRITES.GetLocation(), &Config::MAIN_ALLOW_SD_WRITES.GetLocation(),
&Config::MAIN_DPL2_DECODER.GetLocation(), &Config::MAIN_DPL2_DECODER.GetLocation(),
&Config::MAIN_DPL2_QUALITY.GetLocation(), &Config::MAIN_DPL2_QUALITY.GetLocation(),
&Config::MAIN_AUDIO_LATENCY.GetLocation(),
&Config::MAIN_AUDIO_STRETCH.GetLocation(),
&Config::MAIN_AUDIO_STRETCH_LATENCY.GetLocation(),
&Config::MAIN_RAM_OVERRIDE_ENABLE.GetLocation(), &Config::MAIN_RAM_OVERRIDE_ENABLE.GetLocation(),
&Config::MAIN_MEM1_SIZE.GetLocation(), &Config::MAIN_MEM1_SIZE.GetLocation(),
&Config::MAIN_MEM2_SIZE.GetLocation(), &Config::MAIN_MEM2_SIZE.GetLocation(),
@ -64,6 +67,7 @@ bool IsSettingSaveable(const Config::Location& config_location)
&Config::MAIN_ENABLE_SAVESTATES.GetLocation(), &Config::MAIN_ENABLE_SAVESTATES.GetLocation(),
&Config::MAIN_FALLBACK_REGION.GetLocation(), &Config::MAIN_FALLBACK_REGION.GetLocation(),
&Config::MAIN_REAL_WII_REMOTE_REPEAT_REPORTS.GetLocation(), &Config::MAIN_REAL_WII_REMOTE_REPEAT_REPORTS.GetLocation(),
&Config::MAIN_DSP_HLE.GetLocation(),
// Main.Interface // Main.Interface

View File

@ -93,7 +93,6 @@ void SConfig::SaveSettings()
SaveGameListSettings(ini); SaveGameListSettings(ini);
SaveCoreSettings(ini); SaveCoreSettings(ini);
SaveMovieSettings(ini); SaveMovieSettings(ini);
SaveDSPSettings(ini);
SaveInputSettings(ini); SaveInputSettings(ini);
SaveFifoPlayerSettings(ini); SaveFifoPlayerSettings(ini);
SaveBluetoothPassthroughSettings(ini); SaveBluetoothPassthroughSettings(ini);
@ -207,7 +206,6 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("CPUCore", cpu_core); core->Set("CPUCore", cpu_core);
core->Set("Fastmem", bFastmem); core->Set("Fastmem", bFastmem);
core->Set("CPUThread", bCPUThread); core->Set("CPUThread", bCPUThread);
core->Set("DSPHLE", bDSPHLE);
core->Set("SyncOnSkipIdle", bSyncGPUOnSkipIdleHack); core->Set("SyncOnSkipIdle", bSyncGPUOnSkipIdleHack);
core->Set("SyncGPU", bSyncGPU); core->Set("SyncGPU", bSyncGPU);
core->Set("SyncGpuMaxDistance", iSyncGpuMaxDistance); core->Set("SyncGpuMaxDistance", iSyncGpuMaxDistance);
@ -219,10 +217,6 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("AccurateNaNs", bAccurateNaNs); core->Set("AccurateNaNs", bAccurateNaNs);
core->Set("SelectedLanguage", SelectedLanguage); core->Set("SelectedLanguage", SelectedLanguage);
core->Set("OverrideRegionSettings", bOverrideRegionSettings); core->Set("OverrideRegionSettings", bOverrideRegionSettings);
core->Set("DPL2Decoder", bDPL2Decoder);
core->Set("AudioLatency", iLatency);
core->Set("AudioStretch", m_audio_stretch);
core->Set("AudioStretchMaxLatency", m_audio_stretch_max_latency);
core->Set("AgpCartAPath", m_strGbaCartA); core->Set("AgpCartAPath", m_strGbaCartA);
core->Set("AgpCartBPath", m_strGbaCartB); core->Set("AgpCartBPath", m_strGbaCartB);
core->Set("SlotA", m_EXIDevice[0]); core->Set("SlotA", m_EXIDevice[0]);
@ -266,23 +260,6 @@ void SConfig::SaveMovieSettings(IniFile& ini)
movie->Set("ShowRTC", m_ShowRTC); movie->Set("ShowRTC", m_ShowRTC);
} }
void SConfig::SaveDSPSettings(IniFile& ini)
{
IniFile::Section* dsp = ini.GetOrCreateSection("DSP");
dsp->Set("EnableJIT", m_DSPEnableJIT);
dsp->Set("DumpAudio", m_DumpAudio);
dsp->Set("DumpAudioSilent", m_DumpAudioSilent);
dsp->Set("DumpUCode", m_DumpUCode);
dsp->Set("Backend", sBackend);
dsp->Set("Volume", m_Volume);
dsp->Set("CaptureLog", m_DSPCaptureLog);
#ifdef _WIN32
dsp->Set("WASAPIDevice", sWASAPIDevice);
#endif
}
void SConfig::SaveInputSettings(IniFile& ini) void SConfig::SaveInputSettings(IniFile& ini)
{ {
IniFile::Section* input = ini.GetOrCreateSection("Input"); IniFile::Section* input = ini.GetOrCreateSection("Input");
@ -358,7 +335,6 @@ void SConfig::LoadSettings()
LoadGameListSettings(ini); LoadGameListSettings(ini);
LoadCoreSettings(ini); LoadCoreSettings(ini);
LoadMovieSettings(ini); LoadMovieSettings(ini);
LoadDSPSettings(ini);
LoadInputSettings(ini); LoadInputSettings(ini);
LoadFifoPlayerSettings(ini); LoadFifoPlayerSettings(ini);
LoadBluetoothPassthroughSettings(ini); LoadBluetoothPassthroughSettings(ini);
@ -470,17 +446,12 @@ void SConfig::LoadCoreSettings(IniFile& ini)
#endif #endif
core->Get("JITFollowBranch", &bJITFollowBranch, true); core->Get("JITFollowBranch", &bJITFollowBranch, true);
core->Get("Fastmem", &bFastmem, true); core->Get("Fastmem", &bFastmem, true);
core->Get("DSPHLE", &bDSPHLE, true);
core->Get("TimingVariance", &iTimingVariance, 40); core->Get("TimingVariance", &iTimingVariance, 40);
core->Get("CPUThread", &bCPUThread, true); core->Get("CPUThread", &bCPUThread, true);
core->Get("SyncOnSkipIdle", &bSyncGPUOnSkipIdleHack, true); core->Get("SyncOnSkipIdle", &bSyncGPUOnSkipIdleHack, true);
core->Get("SelectedLanguage", &SelectedLanguage, core->Get("SelectedLanguage", &SelectedLanguage,
DiscIO::ToGameCubeLanguage(Config::GetDefaultLanguage())); DiscIO::ToGameCubeLanguage(Config::GetDefaultLanguage()));
core->Get("OverrideRegionSettings", &bOverrideRegionSettings, false); core->Get("OverrideRegionSettings", &bOverrideRegionSettings, false);
core->Get("DPL2Decoder", &bDPL2Decoder, false);
core->Get("AudioLatency", &iLatency, 20);
core->Get("AudioStretch", &m_audio_stretch, false);
core->Get("AudioStretchMaxLatency", &m_audio_stretch_max_latency, 80);
core->Get("AgpCartAPath", &m_strGbaCartA); core->Get("AgpCartAPath", &m_strGbaCartA);
core->Get("AgpCartBPath", &m_strGbaCartB); core->Get("AgpCartBPath", &m_strGbaCartB);
core->Get("SlotA", (int*)&m_EXIDevice[0], ExpansionInterface::EXIDEVICE_MEMORYCARDFOLDER); core->Get("SlotA", (int*)&m_EXIDevice[0], ExpansionInterface::EXIDEVICE_MEMORYCARDFOLDER);
@ -538,25 +509,6 @@ void SConfig::LoadMovieSettings(IniFile& ini)
movie->Get("ShowRTC", &m_ShowRTC, false); movie->Get("ShowRTC", &m_ShowRTC, false);
} }
void SConfig::LoadDSPSettings(IniFile& ini)
{
IniFile::Section* dsp = ini.GetOrCreateSection("DSP");
dsp->Get("EnableJIT", &m_DSPEnableJIT, true);
dsp->Get("DumpAudio", &m_DumpAudio, false);
dsp->Get("DumpAudioSilent", &m_DumpAudioSilent, false);
dsp->Get("DumpUCode", &m_DumpUCode, false);
dsp->Get("Backend", &sBackend, AudioCommon::GetDefaultSoundBackend());
dsp->Get("Volume", &m_Volume, 100);
dsp->Get("CaptureLog", &m_DSPCaptureLog, false);
#ifdef _WIN32
dsp->Get("WASAPIDevice", &sWASAPIDevice, "default");
#endif
m_IsMuted = false;
}
void SConfig::LoadInputSettings(IniFile& ini) void SConfig::LoadInputSettings(IniFile& ini)
{ {
IniFile::Section* input = ini.GetOrCreateSection("Input"); IniFile::Section* input = ini.GetOrCreateSection("Input");
@ -749,7 +701,6 @@ void SConfig::LoadDefaults()
bCPUThread = false; bCPUThread = false;
bSyncGPUOnSkipIdleHack = true; bSyncGPUOnSkipIdleHack = true;
bRunCompareServer = false; bRunCompareServer = false;
bDSPHLE = true;
bFastmem = true; bFastmem = true;
bFloatExceptions = false; bFloatExceptions = false;
bDivideByZeroExceptions = false; bDivideByZeroExceptions = false;
@ -764,10 +715,6 @@ void SConfig::LoadDefaults()
SelectedLanguage = 0; SelectedLanguage = 0;
bOverrideRegionSettings = false; bOverrideRegionSettings = false;
bWii = false; bWii = false;
bDPL2Decoder = false;
iLatency = 20;
m_audio_stretch = false;
m_audio_stretch_max_latency = 80;
bLoopFifoReplay = true; bLoopFifoReplay = true;
@ -1057,8 +1004,3 @@ IniFile SConfig::LoadGameIni(const std::string& id, std::optional<u16> revision)
game_ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + filename, true); game_ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + filename, true);
return game_ini; return game_ini;
} }
bool SConfig::ShouldUseDPL2Decoder() const
{
return bDPL2Decoder && !bDSPHLE;
}

View File

@ -47,15 +47,6 @@ enum SIDevices : int;
struct BootParameters; struct BootParameters;
// DSP Backend Types
#define BACKEND_NULLSOUND _trans("No Audio Output")
#define BACKEND_ALSA "ALSA"
#define BACKEND_CUBEB "Cubeb"
#define BACKEND_OPENAL "OpenAL"
#define BACKEND_PULSEAUDIO "Pulse"
#define BACKEND_OPENSLES "OpenSLES"
#define BACKEND_WASAPI _trans("WASAPI (Exclusive Mode)")
enum class GPUDeterminismMode enum class GPUDeterminismMode
{ {
Auto, Auto,
@ -116,17 +107,10 @@ struct SConfig
int iTimingVariance = 40; // in milli secounds int iTimingVariance = 40; // in milli secounds
bool bCPUThread = true; bool bCPUThread = true;
bool bDSPThread = false;
bool bDSPHLE = true;
bool bSyncGPUOnSkipIdleHack = true; bool bSyncGPUOnSkipIdleHack = true;
bool bHLE_BS2 = true; bool bHLE_BS2 = true;
bool bCopyWiiSaveNetplay = true; bool bCopyWiiSaveNetplay = true;
bool bDPL2Decoder = false;
int iLatency = 20;
bool m_audio_stretch = false;
int m_audio_stretch_max_latency = 80;
bool bRunCompareServer = false; bool bRunCompareServer = false;
bool bRunCompareClient = false; bool bRunCompareClient = false;
@ -176,9 +160,6 @@ struct SConfig
bool bEnableCustomRTC; bool bEnableCustomRTC;
u32 m_customRTCValue; u32 m_customRTCValue;
// DPL2
bool ShouldUseDPL2Decoder() const;
DiscIO::Region m_region; DiscIO::Region m_region;
std::string m_strGPUDeterminismMode; std::string m_strGPUDeterminismMode;
@ -299,21 +280,6 @@ struct SConfig
bool m_PauseOnFocusLost; bool m_PauseOnFocusLost;
// DSP settings
bool m_DSPEnableJIT;
bool m_DSPCaptureLog;
bool m_DumpAudio;
bool m_DumpAudioSilent;
bool m_IsMuted;
bool m_DumpUCode;
int m_Volume;
std::string sBackend;
#ifdef _WIN32
// WSAPI settings
std::string sWASAPIDevice;
#endif
// Input settings // Input settings
bool m_BackgroundInput; bool m_BackgroundInput;
bool m_AdapterRumble[4]; bool m_AdapterRumble[4];
@ -347,7 +313,6 @@ private:
void SaveInterfaceSettings(IniFile& ini); void SaveInterfaceSettings(IniFile& ini);
void SaveGameListSettings(IniFile& ini); void SaveGameListSettings(IniFile& ini);
void SaveCoreSettings(IniFile& ini); void SaveCoreSettings(IniFile& ini);
void SaveDSPSettings(IniFile& ini);
void SaveInputSettings(IniFile& ini); void SaveInputSettings(IniFile& ini);
void SaveMovieSettings(IniFile& ini); void SaveMovieSettings(IniFile& ini);
void SaveFifoPlayerSettings(IniFile& ini); void SaveFifoPlayerSettings(IniFile& ini);
@ -360,7 +325,6 @@ private:
void LoadInterfaceSettings(IniFile& ini); void LoadInterfaceSettings(IniFile& ini);
void LoadGameListSettings(IniFile& ini); void LoadGameListSettings(IniFile& ini);
void LoadCoreSettings(IniFile& ini); void LoadCoreSettings(IniFile& ini);
void LoadDSPSettings(IniFile& ini);
void LoadInputSettings(IniFile& ini); void LoadInputSettings(IniFile& ini);
void LoadMovieSettings(IniFile& ini); void LoadMovieSettings(IniFile& ini);
void LoadFifoPlayerSettings(IniFile& ini); void LoadFifoPlayerSettings(IniFile& ini);

View File

@ -38,6 +38,7 @@
#include "Core/Boot/Boot.h" #include "Core/Boot/Boot.h"
#include "Core/BootManager.h" #include "Core/BootManager.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/CoreTiming.h" #include "Core/CoreTiming.h"
#include "Core/DSPEmulator.h" #include "Core/DSPEmulator.h"
@ -565,11 +566,11 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
g_renderer->EndUIFrame(); g_renderer->EndUIFrame();
if (cpu_info.HTT) if (cpu_info.HTT)
SConfig::GetInstance().bDSPThread = cpu_info.num_cores > 4; Config::SetBaseOrCurrent(Config::MAIN_DSP_THREAD, cpu_info.num_cores > 4);
else else
SConfig::GetInstance().bDSPThread = cpu_info.num_cores > 2; Config::SetBaseOrCurrent(Config::MAIN_DSP_THREAD, cpu_info.num_cores > 2);
if (!DSP::GetDSPEmulator()->Initialize(core_parameter.bWii, core_parameter.bDSPThread)) if (!DSP::GetDSPEmulator()->Initialize(core_parameter.bWii, Config::Get(Config::MAIN_DSP_THREAD)))
{ {
PanicAlertFmt("Failed to initialize DSP emulation!"); PanicAlertFmt("Failed to initialize DSP emulation!");
return; return;
@ -921,9 +922,9 @@ void UpdateTitle(u32 ElapseTime)
(VideoInterface::GetTargetRefreshRate() * ElapseTime)); (VideoInterface::GetTargetRefreshRate() * ElapseTime));
// Settings are shown the same for both extended and summary info // Settings are shown the same for both extended and summary info
const std::string SSettings = const std::string SSettings = fmt::format(
fmt::format("{} {} | {} | {}", PowerPC::GetCPUName(), _CoreParameter.bCPUThread ? "DC" : "SC", "{} {} | {} | {}", PowerPC::GetCPUName(), _CoreParameter.bCPUThread ? "DC" : "SC",
g_video_backend->GetDisplayName(), _CoreParameter.bDSPHLE ? "HLE" : "LLE"); g_video_backend->GetDisplayName(), Config::Get(Config::MAIN_DSP_HLE) ? "HLE" : "LLE");
std::string SFPS; std::string SFPS;
if (Movie::IsPlayingInput()) if (Movie::IsPlayingInput())

View File

@ -353,13 +353,13 @@ void DolphinAnalytics::MakePerGameBuilder()
builder.AddData("id", MakeUniqueId(SConfig::GetInstance().GetGameID())); builder.AddData("id", MakeUniqueId(SConfig::GetInstance().GetGameID()));
// Configuration. // Configuration.
builder.AddData("cfg-dsp-hle", SConfig::GetInstance().bDSPHLE); builder.AddData("cfg-dsp-hle", Config::Get(Config::MAIN_DSP_HLE));
builder.AddData("cfg-dsp-jit", SConfig::GetInstance().m_DSPEnableJIT); builder.AddData("cfg-dsp-jit", Config::Get(Config::MAIN_DSP_JIT));
builder.AddData("cfg-dsp-thread", SConfig::GetInstance().bDSPThread); builder.AddData("cfg-dsp-thread", Config::Get(Config::MAIN_DSP_THREAD));
builder.AddData("cfg-cpu-thread", SConfig::GetInstance().bCPUThread); builder.AddData("cfg-cpu-thread", SConfig::GetInstance().bCPUThread);
builder.AddData("cfg-fastmem", SConfig::GetInstance().bFastmem); builder.AddData("cfg-fastmem", SConfig::GetInstance().bFastmem);
builder.AddData("cfg-syncgpu", SConfig::GetInstance().bSyncGPU); builder.AddData("cfg-syncgpu", SConfig::GetInstance().bSyncGPU);
builder.AddData("cfg-audio-backend", SConfig::GetInstance().sBackend); builder.AddData("cfg-audio-backend", Config::Get(Config::MAIN_AUDIO_BACKEND));
builder.AddData("cfg-oc-enable", SConfig::GetInstance().m_OCEnable); builder.AddData("cfg-oc-enable", SConfig::GetInstance().m_OCEnable);
builder.AddData("cfg-oc-factor", SConfig::GetInstance().m_OCFactor); builder.AddData("cfg-oc-factor", SConfig::GetInstance().m_OCFactor);
builder.AddData("cfg-render-to-main", Config::Get(Config::MAIN_RENDER_TO_MAIN)); builder.AddData("cfg-render-to-main", Config::Get(Config::MAIN_RENDER_TO_MAIN));

View File

@ -13,6 +13,7 @@
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Hash.h" #include "Common/Hash.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/DSP/DSPCodeUtil.h" #include "Core/DSP/DSPCodeUtil.h"
#include "Core/HW/DSPHLE/DSPHLE.h" #include "Core/HW/DSPHLE/DSPHLE.h"
@ -102,7 +103,7 @@ void ROMUCode::BootUCode()
Common::HashEctor(static_cast<u8*>(HLEMemory_Get_Pointer(m_current_ucode.m_ram_address)), Common::HashEctor(static_cast<u8*>(HLEMemory_Get_Pointer(m_current_ucode.m_ram_address)),
m_current_ucode.m_length); m_current_ucode.m_length);
if (SConfig::GetInstance().m_DumpUCode) if (Config::Get(Config::MAIN_DUMP_UCODE))
{ {
DSP::DumpDSPCode(static_cast<u8*>(HLEMemory_Get_Pointer(m_current_ucode.m_ram_address)), DSP::DumpDSPCode(static_cast<u8*>(HLEMemory_Get_Pointer(m_current_ucode.m_ram_address)),
m_current_ucode.m_length, ector_crc); m_current_ucode.m_length, ector_crc);

View File

@ -16,6 +16,7 @@
#include "Common/Hash.h" #include "Common/Hash.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/Swap.h" #include "Common/Swap.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/DSP/DSPCodeUtil.h" #include "Core/DSP/DSPCodeUtil.h"
#include "Core/HW/DSPHLE/DSPHLE.h" #include "Core/HW/DSPHLE/DSPHLE.h"
@ -183,7 +184,7 @@ void UCodeInterface::PrepareBootUCode(u32 mail)
Common::HashEctor(static_cast<u8*>(HLEMemory_Get_Pointer(m_next_ucode.iram_mram_addr)), Common::HashEctor(static_cast<u8*>(HLEMemory_Get_Pointer(m_next_ucode.iram_mram_addr)),
m_next_ucode.iram_size); m_next_ucode.iram_size);
if (SConfig::GetInstance().m_DumpUCode) if (Config::Get(Config::MAIN_DUMP_UCODE))
{ {
DSP::DumpDSPCode(Memory::GetPointer(m_next_ucode.iram_mram_addr), m_next_ucode.iram_size, DSP::DumpDSPCode(Memory::GetPointer(m_next_ucode.iram_mram_addr), m_next_ucode.iram_size,
ector_crc); ector_crc);

View File

@ -8,6 +8,7 @@
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Hash.h" #include "Common/Hash.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/DSP/DSPAnalyzer.h" #include "Core/DSP/DSPAnalyzer.h"
#include "Core/DSP/DSPCodeUtil.h" #include "Core/DSP/DSPCodeUtil.h"
@ -53,7 +54,7 @@ void OSD_AddMessage(std::string str, u32 ms)
bool OnThread() bool OnThread()
{ {
return SConfig::GetInstance().bDSPThread; return Config::Get(Config::MAIN_DSP_THREAD);
} }
bool IsWiiHost() bool IsWiiHost()
@ -78,7 +79,7 @@ void CodeLoaded(DSPCore& dsp, const u8* ptr, size_t size)
const u32 iram_crc = Common::HashEctor(ptr, size); const u32 iram_crc = Common::HashEctor(ptr, size);
state.SetIRAMCRC(iram_crc); state.SetIRAMCRC(iram_crc);
if (SConfig::GetInstance().m_DumpUCode) if (Config::Get(Config::MAIN_DUMP_UCODE))
{ {
DSP::DumpDSPCode(ptr, size, iram_crc); DSP::DumpDSPCode(ptr, size, iram_crc);
} }

View File

@ -15,6 +15,7 @@
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MemoryUtil.h" #include "Common/MemoryUtil.h"
#include "Common/Thread.h" #include "Common/Thread.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/DSP/DSPAccelerator.h" #include "Core/DSP/DSPAccelerator.h"
@ -120,11 +121,11 @@ static bool FillDSPInitOptions(DSPInitOptions* opts)
opts->core_type = DSPInitOptions::CoreType::Interpreter; opts->core_type = DSPInitOptions::CoreType::Interpreter;
#ifdef _M_X86 #ifdef _M_X86
if (SConfig::GetInstance().m_DSPEnableJIT) if (Config::Get(Config::MAIN_DSP_JIT))
opts->core_type = DSPInitOptions::CoreType::JIT64; opts->core_type = DSPInitOptions::CoreType::JIT64;
#endif #endif
if (SConfig::GetInstance().m_DSPCaptureLog) if (Config::Get(Config::MAIN_DSP_CAPTURE_LOG))
{ {
const std::string pcap_path = File::GetUserPath(D_DUMPDSP_IDX) + "dsp.pcap"; const std::string pcap_path = File::GetUserPath(D_DUMPDSP_IDX) + "dsp.pcap";
opts->capture_logger = new PCAPDSPCaptureLogger(pcap_path); opts->capture_logger = new PCAPDSPCaptureLogger(pcap_path);
@ -263,7 +264,7 @@ void DSPLLE::DSP_Update(int cycles)
DSP_StopSoundStream(); DSP_StopSoundStream();
m_is_dsp_on_thread = false; m_is_dsp_on_thread = false;
m_request_disable_thread = false; m_request_disable_thread = false;
SConfig::GetInstance().bDSPThread = false; Config::SetBaseOrCurrent(Config::MAIN_DSP_THREAD, false);
} }
} }

View File

@ -6,6 +6,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/CoreTiming.h" #include "Core/CoreTiming.h"
@ -42,7 +43,7 @@ void Init()
ExpansionInterface::Init(); // Needs to be initialized before Memory ExpansionInterface::Init(); // Needs to be initialized before Memory
Memory::Init(); // Needs to be initialized before AddressSpace Memory::Init(); // Needs to be initialized before AddressSpace
AddressSpace::Init(); AddressSpace::Init();
DSP::Init(SConfig::GetInstance().bDSPHLE); DSP::Init(Config::Get(Config::MAIN_DSP_HLE));
DVDInterface::Init(); DVDInterface::Init();
GPFifo::Init(); GPFifo::Init();
CPU::Init(SConfig::GetInstance().cpu_core); CPU::Init(SConfig::GetInstance().cpu_core);

View File

@ -11,6 +11,7 @@
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/Swap.h" #include "Common/Swap.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/DSPEmulator.h" #include "Core/DSPEmulator.h"
@ -40,8 +41,9 @@ static void ReinitHardware()
PowerPC::Reset(); PowerPC::Reset();
Wiimote::ResetAllWiimotes(); Wiimote::ResetAllWiimotes();
// Note: this is specific to Dolphin and is required because we initialised it in Wii mode. // Note: this is specific to Dolphin and is required because we initialised it in Wii mode.
DSP::Reinit(SConfig::GetInstance().bDSPHLE); DSP::Reinit(Config::Get(Config::MAIN_DSP_HLE));
DSP::GetDSPEmulator()->Initialize(SConfig::GetInstance().bWii, SConfig::GetInstance().bDSPThread); DSP::GetDSPEmulator()->Initialize(SConfig::GetInstance().bWii,
Config::Get(Config::MAIN_DSP_THREAD));
SystemTimers::ChangePPCClock(SystemTimers::Mode::GC); SystemTimers::ChangePPCClock(SystemTimers::Mode::GC);
} }

View File

@ -17,6 +17,7 @@
#include "Core/Config/FreeLookSettings.h" #include "Core/Config/FreeLookSettings.h"
#include "Core/Config/GraphicsSettings.h" #include "Core/Config/GraphicsSettings.h"
#include "Core/Config/MainSettings.h"
#include "Core/Config/UISettings.h" #include "Core/Config/UISettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
@ -329,9 +330,9 @@ void HotkeyScheduler::Run()
auto ShowVolume = []() { auto ShowVolume = []() {
OSD::AddMessage(std::string("Volume: ") + OSD::AddMessage(std::string("Volume: ") +
(SConfig::GetInstance().m_IsMuted ? (Config::Get(Config::MAIN_AUDIO_MUTED) ?
"Muted" : "Muted" :
std::to_string(SConfig::GetInstance().m_Volume) + "%")); std::to_string(Config::Get(Config::MAIN_AUDIO_VOLUME)) + "%"));
}; };
// Volume // Volume

View File

@ -22,6 +22,7 @@
#include "Common/CDUtils.h" #include "Common/CDUtils.h"
#include "Core/Boot/Boot.h" #include "Core/Boot/Boot.h"
#include "Core/CommonTitles.h" #include "Core/CommonTitles.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/Debugger/RSO.h" #include "Core/Debugger/RSO.h"
@ -789,9 +790,9 @@ void MenuBar::AddMovieMenu()
auto* dump_audio = movie_menu->addAction(tr("Dump Audio")); auto* dump_audio = movie_menu->addAction(tr("Dump Audio"));
dump_audio->setCheckable(true); dump_audio->setCheckable(true);
dump_audio->setChecked(SConfig::GetInstance().m_DumpAudio); dump_audio->setChecked(Config::Get(Config::MAIN_DUMP_AUDIO));
connect(dump_audio, &QAction::toggled, connect(dump_audio, &QAction::toggled,
[](bool value) { SConfig::GetInstance().m_DumpAudio = value; }); [](bool value) { Config::SetBaseOrCurrent(Config::MAIN_DUMP_AUDIO, value); });
} }
void MenuBar::AddJITMenu() void MenuBar::AddJITMenu()

View File

@ -365,14 +365,14 @@ bool Settings::IsKeepWindowOnTopEnabled() const
int Settings::GetVolume() const int Settings::GetVolume() const
{ {
return SConfig::GetInstance().m_Volume; return Config::Get(Config::MAIN_AUDIO_VOLUME);
} }
void Settings::SetVolume(int volume) void Settings::SetVolume(int volume)
{ {
if (GetVolume() != volume) if (GetVolume() != volume)
{ {
SConfig::GetInstance().m_Volume = volume; Config::SetBaseOrCurrent(Config::MAIN_AUDIO_VOLUME, volume);
emit VolumeChanged(volume); emit VolumeChanged(volume);
} }
} }

View File

@ -22,7 +22,6 @@
#include "AudioCommon/WASAPIStream.h" #include "AudioCommon/WASAPIStream.h"
#include "Core/Config/MainSettings.h" #include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "DolphinQt/Config/SettingsWindow.h" #include "DolphinQt/Config/SettingsWindow.h"
@ -200,18 +199,18 @@ void AudioPane::LoadSettings()
auto& settings = Settings::Instance(); auto& settings = Settings::Instance();
// DSP // DSP
if (SConfig::GetInstance().bDSPHLE) if (Config::Get(Config::MAIN_DSP_HLE))
{ {
m_dsp_hle->setChecked(true); m_dsp_hle->setChecked(true);
} }
else else
{ {
m_dsp_lle->setChecked(SConfig::GetInstance().m_DSPEnableJIT); m_dsp_lle->setChecked(Config::Get(Config::MAIN_DSP_JIT));
m_dsp_interpreter->setChecked(!SConfig::GetInstance().m_DSPEnableJIT); m_dsp_interpreter->setChecked(!Config::Get(Config::MAIN_DSP_JIT));
} }
// Backend // Backend
const auto current = SConfig::GetInstance().sBackend; const auto current = Config::Get(Config::MAIN_AUDIO_BACKEND);
bool selection_set = false; bool selection_set = false;
for (const auto& backend : AudioCommon::GetSoundBackends()) for (const auto& backend : AudioCommon::GetSoundBackends())
{ {
@ -231,7 +230,7 @@ void AudioPane::LoadSettings()
OnVolumeChanged(settings.GetVolume()); OnVolumeChanged(settings.GetVolume());
// DPL2 // DPL2
m_dolby_pro_logic->setChecked(SConfig::GetInstance().bDPL2Decoder); m_dolby_pro_logic->setChecked(Config::Get(Config::MAIN_DPL2_DECODER));
m_dolby_quality_slider->setValue(int(Config::Get(Config::MAIN_DPL2_QUALITY))); m_dolby_quality_slider->setValue(int(Config::Get(Config::MAIN_DPL2_QUALITY)));
m_dolby_quality_latency_label->setText( m_dolby_quality_latency_label->setText(
GetDPL2ApproximateLatencyLabel(Config::Get(Config::MAIN_DPL2_QUALITY))); GetDPL2ApproximateLatencyLabel(Config::Get(Config::MAIN_DPL2_QUALITY)));
@ -242,23 +241,23 @@ void AudioPane::LoadSettings()
// Latency // Latency
if (m_latency_control_supported) if (m_latency_control_supported)
m_latency_spin->setValue(SConfig::GetInstance().iLatency); m_latency_spin->setValue(Config::Get(Config::MAIN_AUDIO_LATENCY));
// Stretch // Stretch
m_stretching_enable->setChecked(SConfig::GetInstance().m_audio_stretch); m_stretching_enable->setChecked(Config::Get(Config::MAIN_AUDIO_STRETCH));
m_stretching_buffer_slider->setValue(SConfig::GetInstance().m_audio_stretch_max_latency); m_stretching_buffer_slider->setValue(Config::Get(Config::MAIN_AUDIO_STRETCH_LATENCY));
m_stretching_buffer_slider->setEnabled(m_stretching_enable->isChecked()); m_stretching_buffer_slider->setEnabled(m_stretching_enable->isChecked());
m_stretching_buffer_indicator->setText(tr("%1 ms").arg(m_stretching_buffer_slider->value())); m_stretching_buffer_indicator->setText(tr("%1 ms").arg(m_stretching_buffer_slider->value()));
#ifdef _WIN32 #ifdef _WIN32
if (SConfig::GetInstance().sWASAPIDevice == "default") if (Config::Get(Config::MAIN_WASAPI_DEVICE) == "default")
{ {
m_wasapi_device_combo->setCurrentIndex(0); m_wasapi_device_combo->setCurrentIndex(0);
} }
else else
{ {
m_wasapi_device_combo->setCurrentText( m_wasapi_device_combo->setCurrentText(
QString::fromStdString(SConfig::GetInstance().sWASAPIDevice)); QString::fromStdString(Config::Get(Config::MAIN_WASAPI_DEVICE)));
} }
#endif #endif
} }
@ -268,24 +267,23 @@ void AudioPane::SaveSettings()
auto& settings = Settings::Instance(); auto& settings = Settings::Instance();
// DSP // DSP
if (SConfig::GetInstance().bDSPHLE != m_dsp_hle->isChecked() || if (Config::Get(Config::MAIN_DSP_HLE) != m_dsp_hle->isChecked() ||
SConfig::GetInstance().m_DSPEnableJIT != m_dsp_lle->isChecked()) Config::Get(Config::MAIN_DSP_JIT) != m_dsp_lle->isChecked())
{ {
OnDspChanged(); OnDspChanged();
} }
SConfig::GetInstance().bDSPHLE = m_dsp_hle->isChecked();
Config::SetBaseOrCurrent(Config::MAIN_DSP_HLE, m_dsp_hle->isChecked()); Config::SetBaseOrCurrent(Config::MAIN_DSP_HLE, m_dsp_hle->isChecked());
SConfig::GetInstance().m_DSPEnableJIT = m_dsp_lle->isChecked();
Config::SetBaseOrCurrent(Config::MAIN_DSP_JIT, m_dsp_lle->isChecked()); Config::SetBaseOrCurrent(Config::MAIN_DSP_JIT, m_dsp_lle->isChecked());
// Backend // Backend
const auto selection = const auto selection =
m_backend_combo->itemData(m_backend_combo->currentIndex()).toString().toStdString(); m_backend_combo->itemData(m_backend_combo->currentIndex()).toString().toStdString();
auto& backend = SConfig::GetInstance().sBackend; std::string backend = Config::Get(Config::MAIN_AUDIO_BACKEND);
if (selection != backend) if (selection != backend)
{ {
backend = selection; backend = selection;
Config::SetBaseOrCurrent(Config::MAIN_AUDIO_BACKEND, selection);
OnBackendChanged(); OnBackendChanged();
} }
@ -297,7 +295,7 @@ void AudioPane::SaveSettings()
} }
// DPL2 // DPL2
SConfig::GetInstance().bDPL2Decoder = m_dolby_pro_logic->isChecked(); Config::SetBaseOrCurrent(Config::MAIN_DPL2_DECODER, m_dolby_pro_logic->isChecked());
Config::SetBase(Config::MAIN_DPL2_QUALITY, Config::SetBase(Config::MAIN_DPL2_QUALITY,
static_cast<AudioCommon::DPL2Quality>(m_dolby_quality_slider->value())); static_cast<AudioCommon::DPL2Quality>(m_dolby_quality_slider->value()));
m_dolby_quality_latency_label->setText( m_dolby_quality_latency_label->setText(
@ -309,16 +307,16 @@ void AudioPane::SaveSettings()
// Latency // Latency
if (m_latency_control_supported) if (m_latency_control_supported)
SConfig::GetInstance().iLatency = m_latency_spin->value(); Config::SetBaseOrCurrent(Config::MAIN_AUDIO_LATENCY, m_latency_spin->value());
// Stretch // Stretch
SConfig::GetInstance().m_audio_stretch = m_stretching_enable->isChecked(); Config::SetBaseOrCurrent(Config::MAIN_AUDIO_STRETCH, m_stretching_enable->isChecked());
SConfig::GetInstance().m_audio_stretch_max_latency = m_stretching_buffer_slider->value(); Config::SetBaseOrCurrent(Config::MAIN_AUDIO_STRETCH_LATENCY, m_stretching_buffer_slider->value());
m_stretching_buffer_label->setEnabled(m_stretching_enable->isChecked()); m_stretching_buffer_label->setEnabled(m_stretching_enable->isChecked());
m_stretching_buffer_slider->setEnabled(m_stretching_enable->isChecked()); m_stretching_buffer_slider->setEnabled(m_stretching_enable->isChecked());
m_stretching_buffer_indicator->setEnabled(m_stretching_enable->isChecked()); m_stretching_buffer_indicator->setEnabled(m_stretching_enable->isChecked());
m_stretching_buffer_indicator->setText( m_stretching_buffer_indicator->setText(
tr("%1 ms").arg(SConfig::GetInstance().m_audio_stretch_max_latency)); tr("%1 ms").arg(Config::Get(Config::MAIN_AUDIO_STRETCH_LATENCY)));
#ifdef _WIN32 #ifdef _WIN32
std::string device = "default"; std::string device = "default";
@ -326,7 +324,7 @@ void AudioPane::SaveSettings()
if (m_wasapi_device_combo->currentIndex() != 0) if (m_wasapi_device_combo->currentIndex() != 0)
device = m_wasapi_device_combo->currentText().toStdString(); device = m_wasapi_device_combo->currentText().toStdString();
SConfig::GetInstance().sWASAPIDevice = device; Config::SetBaseOrCurrent(Config::MAIN_WASAPI_DEVICE, device);
#endif #endif
AudioCommon::UpdateSoundStream(); AudioCommon::UpdateSoundStream();
@ -334,7 +332,7 @@ void AudioPane::SaveSettings()
void AudioPane::OnDspChanged() void AudioPane::OnDspChanged()
{ {
const auto backend = SConfig::GetInstance().sBackend; const auto backend = Config::Get(Config::MAIN_AUDIO_BACKEND);
m_dolby_pro_logic->setEnabled(AudioCommon::SupportsDPL2Decoder(backend) && m_dolby_pro_logic->setEnabled(AudioCommon::SupportsDPL2Decoder(backend) &&
!m_dsp_hle->isChecked()); !m_dsp_hle->isChecked());
@ -344,7 +342,7 @@ void AudioPane::OnDspChanged()
void AudioPane::OnBackendChanged() void AudioPane::OnBackendChanged()
{ {
const auto backend = SConfig::GetInstance().sBackend; const auto backend = Config::Get(Config::MAIN_AUDIO_BACKEND);
m_dolby_pro_logic->setEnabled(AudioCommon::SupportsDPL2Decoder(backend) && m_dolby_pro_logic->setEnabled(AudioCommon::SupportsDPL2Decoder(backend) &&
!m_dsp_hle->isChecked()); !m_dsp_hle->isChecked());
@ -382,13 +380,14 @@ void AudioPane::OnEmulationStateChanged(bool running)
m_dsp_interpreter->setEnabled(!running); m_dsp_interpreter->setEnabled(!running);
m_backend_label->setEnabled(!running); m_backend_label->setEnabled(!running);
m_backend_combo->setEnabled(!running); m_backend_combo->setEnabled(!running);
if (AudioCommon::SupportsDPL2Decoder(SConfig::GetInstance().sBackend) && !m_dsp_hle->isChecked()) if (AudioCommon::SupportsDPL2Decoder(Config::Get(Config::MAIN_AUDIO_BACKEND)) &&
!m_dsp_hle->isChecked())
{ {
m_dolby_pro_logic->setEnabled(!running); m_dolby_pro_logic->setEnabled(!running);
EnableDolbyQualityWidgets(!running && m_dolby_pro_logic->isChecked()); EnableDolbyQualityWidgets(!running && m_dolby_pro_logic->isChecked());
} }
if (m_latency_control_supported && if (m_latency_control_supported &&
AudioCommon::SupportsLatencyControl(SConfig::GetInstance().sBackend)) AudioCommon::SupportsLatencyControl(Config::Get(Config::MAIN_AUDIO_BACKEND)))
{ {
m_latency_label->setEnabled(!running); m_latency_label->setEnabled(!running);
m_latency_spin->setEnabled(!running); m_latency_spin->setEnabled(!running);