summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/WASAPIStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/AudioCommon/WASAPIStream.cpp')
-rw-r--r--Source/Core/AudioCommon/WASAPIStream.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/Core/AudioCommon/WASAPIStream.cpp b/Source/Core/AudioCommon/WASAPIStream.cpp
index d65471226b..2a15e08195 100644
--- a/Source/Core/AudioCommon/WASAPIStream.cpp
+++ b/Source/Core/AudioCommon/WASAPIStream.cpp
@@ -20,7 +20,7 @@
#include "Common/Logging/Log.h"
#include "Common/StringUtil.h"
#include "Common/Thread.h"
-#include "Core/ConfigManager.h"
+#include "Core/Config/MainSettings.h"
#include "VideoCommon/OnScreenDisplay.h"
using Microsoft::WRL::ComPtr;
@@ -176,19 +176,19 @@ bool WASAPIStream::SetRunning(bool running)
HRESULT result;
- if (SConfig::GetInstance().sWASAPIDevice == "default")
+ if (Config::Get(Config::MAIN_WASAPI_DEVICE) == "default")
{
result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, device.GetAddressOf());
}
else
{
result = S_OK;
- device = GetDeviceByName(SConfig::GetInstance().sWASAPIDevice);
+ device = GetDeviceByName(Config::Get(Config::MAIN_WASAPI_DEVICE));
if (!device)
{
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());
}
}
@@ -222,7 +222,7 @@ bool WASAPIStream::SetRunning(bool running)
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);
if (!HandleWinAPI("Failed to obtain device period", result))
@@ -258,7 +258,7 @@ bool WASAPIStream::SetRunning(bool running)
device_period =
static_cast<REFERENCE_TIME>(
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(
AUDCLNT_SHAREMODE_EXCLUSIVE,
@@ -333,13 +333,13 @@ void WASAPIStream::SoundLoop()
s16* audio_data = reinterpret_cast<s16*>(data);
GetMixer()->Mix(audio_data, m_frames_in_buffer);
- const SConfig& config = SConfig::GetInstance();
- const bool is_muted = config.m_IsMuted || config.m_Volume == 0;
- const bool need_volume_adjustment = config.m_Volume != 100 && !is_muted;
+ const bool is_muted =
+ Config::Get(Config::MAIN_AUDIO_MUTED) || Config::Get(Config::MAIN_AUDIO_VOLUME) == 0;
+ const bool need_volume_adjustment = Config::Get(Config::MAIN_AUDIO_VOLUME) != 100 && !is_muted;
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++)
*audio_data++ *= volume;