Migrate force_log_printf to new logging (#714)

This commit is contained in:
why-keith 2023-04-12 15:31:34 +01:00 committed by GitHub
parent 072c18a6e3
commit 4be57f4896
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 401 additions and 399 deletions

View file

@ -116,7 +116,7 @@ void DirectSoundAPI::AudioThread()
if (FAILED(hr))
{
forceLog_printf("DirectSound: Dropped audio block due to locking failure");
cemuLog_log(LogType::Force, "DirectSound: Dropped audio block due to locking failure");
continue;
}

View file

@ -27,14 +27,15 @@ IAudioAPI::IAudioAPI(uint32 samplerate, uint32 channels, uint32 samples_per_bloc
void IAudioAPI::PrintLogging()
{
forceLog_printf("------- Init Audio backend -------");
forceLog_printf("DirectSound: %s", s_availableApis[DirectSound] ? "available" : "not supported");
forceLog_printf("XAudio 2.8: %s", s_availableApis[XAudio2] ? "available" : "not supported");
cemuLog_log(LogType::Force, "------- Init Audio backend -------");
cemuLog_log(LogType::Force, "DirectSound: {}", s_availableApis[DirectSound] ? "available" : "not supported");
cemuLog_log(LogType::Force, "XAudio 2.8: {}", s_availableApis[XAudio2] ? "available" : "not supported");
if (!s_availableApis[XAudio2])
{
forceLog_printf("XAudio 2.7: %s", s_availableApis[XAudio27] ? "available" : "not supported")
cemuLog_log(LogType::Force, "XAudio 2.7: {}", s_availableApis[XAudio27] ? "available" : "not supported");
}
forceLog_printf("Cubeb: %s", s_availableApis[Cubeb] ? "available" : "not supported");
cemuLog_log(LogType::Force, "Cubeb: {}", s_availableApis[Cubeb] ? "available" : "not supported");
}
void IAudioAPI::InitWFX(sint32 samplerate, sint32 channels, sint32 bits_per_sample)

View file

@ -16,8 +16,8 @@ IAudioInputAPI::IAudioInputAPI(uint32 samplerate, uint32 channels, uint32 sample
void IAudioInputAPI::PrintLogging()
{
forceLog_printf("------- Init Audio input backend -------");
forceLog_printf("Cubeb: %s", s_availableApis[Cubeb] ? "available" : "not supported");
cemuLog_log(LogType::Force, "------- Init Audio input backend -------");
cemuLog_log(LogType::Force, "Cubeb: {}", s_availableApis[Cubeb] ? "available" : "not supported");
}
void IAudioInputAPI::InitializeStatic()

View file

@ -49,8 +49,8 @@ XAudio2API::XAudio2API(std::wstring device_id, uint32 samplerate, uint32 channel
m_wfx.Format.nChannels = channels;
m_wfx.Format.nSamplesPerSec = samplerate;
m_wfx.Format.wBitsPerSample = bits_per_sample;
m_wfx.Format.nBlockAlign = (m_wfx.Format.nChannels * m_wfx.Format.wBitsPerSample) / 8; // must equal (nChannels × wBitsPerSample) / 8
m_wfx.Format.nAvgBytesPerSec = m_wfx.Format.nSamplesPerSec * m_wfx.Format.nBlockAlign; // must equal nSamplesPerSec × nBlockAlign.
m_wfx.Format.nBlockAlign = (m_wfx.Format.nChannels * m_wfx.Format.wBitsPerSample) / 8; // must equal (nChannels × wBitsPerSample) / 8
m_wfx.Format.nAvgBytesPerSec = m_wfx.Format.nSamplesPerSec * m_wfx.Format.nBlockAlign; // must equal nSamplesPerSec × nBlockAlign.
m_wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
m_wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
@ -258,7 +258,7 @@ const std::vector<XAudio2API::DeviceDescriptionPtr>& XAudio2API::RefreshDevices(
}
catch (const std::system_error& ex)
{
forceLog_printf("XAudio2API::RefreshDevices: error while refreshing device list (%s - code: 0x%08x)", ex.what(), ex.code().value());
cemuLog_log(LogType::Force, "XAudio2API::RefreshDevices: error while refreshing device list ({} - code: 0x{:08x})", ex.what(), ex.code().value());
}
CoUninitialize();