Update fmtlib

This commit is contained in:
Jack Andersen
2020-04-11 12:46:05 -10:00
parent de85119690
commit c36895a109
29 changed files with 300 additions and 301 deletions

View File

@@ -121,14 +121,14 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
#if !WINDOWS_STORE
if (!m_device) {
if (FAILED(m_enumerator->GetDevice(MBSTWCS(m_sinkName.c_str()).c_str(), &m_device))) {
Log.report(logvisor::Error, fmt("unable to obtain audio device {}"), m_sinkName);
Log.report(logvisor::Error, FMT_STRING("unable to obtain audio device {}"), m_sinkName);
m_device.Reset();
return;
}
}
if (FAILED(m_device->Activate(IID_IAudioClient, CLSCTX_ALL, nullptr, &m_audClient))) {
Log.report(logvisor::Error, fmt(L"unable to create audio client from device"));
Log.report(logvisor::Error, FMT_STRING(L"unable to create audio client from device"));
m_device.Reset();
return;
}
@@ -136,7 +136,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
WAVEFORMATEXTENSIBLE* pwfx;
if (FAILED(m_audClient->GetMixFormat((WAVEFORMATEX**)&pwfx))) {
Log.report(logvisor::Error, fmt(L"unable to obtain audio mix format from device"));
Log.report(logvisor::Error, FMT_STRING(L"unable to obtain audio mix format from device"));
#if !WINDOWS_STORE
m_device.Reset();
#endif
@@ -204,7 +204,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
chMapOut.m_channels[7] = AudioChannel::SideRight;
break;
default:
Log.report(logvisor::Warning, fmt("unknown channel layout {}; using stereo"), pwfx->Format.nChannels);
Log.report(logvisor::Warning, FMT_STRING("unknown channel layout {}; using stereo"), pwfx->Format.nChannels);
chMapOut.m_channelCount = 2;
chMapOut.m_channels[0] = AudioChannel::FrontLeft;
chMapOut.m_channels[1] = AudioChannel::FrontRight;
@@ -214,7 +214,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
/* Initialize audio client */
if (FAILED(m_audClient->Initialize(AUDCLNT_SHAREMODE_SHARED, 0, 450000, /* 45ms */
0, (WAVEFORMATEX*)pwfx, nullptr))) {
Log.report(logvisor::Error, fmt(L"unable to initialize audio client"));
Log.report(logvisor::Error, FMT_STRING(L"unable to initialize audio client"));
#if !WINDOWS_STORE
m_device.Reset();
#endif
@@ -235,7 +235,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
m_mixInfo.m_sampleFormat = SOXR_INT32_I;
m_mixInfo.m_bitsPerSample = 32;
} else {
Log.report(logvisor::Fatal, fmt(L"unsupported bits-per-sample {}"), pwfx->Format.wBitsPerSample);
Log.report(logvisor::Fatal, FMT_STRING(L"unsupported bits-per-sample {}"), pwfx->Format.wBitsPerSample);
#if !WINDOWS_STORE
m_device.Reset();
#endif
@@ -248,7 +248,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
m_mixInfo.m_sampleFormat = SOXR_FLOAT32_I;
m_mixInfo.m_bitsPerSample = 32;
} else {
Log.report(logvisor::Error, fmt(L"unsupported floating-point bits-per-sample {}"), pwfx->Format.wBitsPerSample);
Log.report(logvisor::Error, FMT_STRING(L"unsupported floating-point bits-per-sample {}"), pwfx->Format.wBitsPerSample);
#if !WINDOWS_STORE
m_device.Reset();
#endif
@@ -260,7 +260,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
UINT32 bufferFrameCount;
if (FAILED(m_audClient->GetBufferSize(&bufferFrameCount))) {
Log.report(logvisor::Error, fmt(L"unable to get audio buffer frame count"));
Log.report(logvisor::Error, FMT_STRING(L"unable to get audio buffer frame count"));
#if !WINDOWS_STORE
m_device.Reset();
#endif
@@ -269,7 +269,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
m_mixInfo.m_periodFrames = bufferFrameCount;
if (FAILED(m_audClient->GetService(IID_IAudioRenderClient, &m_renderClient))) {
Log.report(logvisor::Error, fmt(L"unable to create audio render client"));
Log.report(logvisor::Error, FMT_STRING(L"unable to create audio render client"));
#if !WINDOWS_STORE
m_device.Reset();
#endif
@@ -346,18 +346,18 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
/* Enumerate default audio device */
if (FAILED(
CoCreateInstance(CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, IID_IMMDeviceEnumerator, &m_enumerator))) {
Log.report(logvisor::Error, fmt(L"unable to create MMDeviceEnumerator instance"));
Log.report(logvisor::Error, FMT_STRING(L"unable to create MMDeviceEnumerator instance"));
return;
}
if (FAILED(m_enumerator->RegisterEndpointNotificationCallback(&m_notificationClient))) {
Log.report(logvisor::Error, fmt(L"unable to register multimedia event callback"));
Log.report(logvisor::Error, FMT_STRING(L"unable to register multimedia event callback"));
m_device.Reset();
return;
}
if (FAILED(m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, &m_device))) {
Log.report(logvisor::Error, fmt(L"unable to obtain default audio device"));
Log.report(logvisor::Error, FMT_STRING(L"unable to obtain default audio device"));
m_device.Reset();
return;
}
@@ -385,7 +385,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
m_started = false;
if (m_mixInfo.m_sampleFormat != oldFmt)
Log.report(logvisor::Fatal, fmt(L"audio device sample format changed, boo doesn't support this!!"));
Log.report(logvisor::Fatal, FMT_STRING(L"audio device sample format changed, boo doesn't support this!!"));
_resetSampleRate();
}
@@ -402,7 +402,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
int attempt = 0;
while (true) {
if (attempt >= 10)
Log.report(logvisor::Fatal, fmt(L"unable to setup AudioRenderClient"));
Log.report(logvisor::Fatal, FMT_STRING(L"unable to setup AudioRenderClient"));
if (m_rebuild) {
m_device.Reset();
@@ -472,7 +472,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
bool setCurrentAudioOutput(const char* name) override {
ComPtr<IMMDevice> newDevice;
if (FAILED(m_enumerator->GetDevice(MBSTWCS(name).c_str(), &newDevice))) {
Log.report(logvisor::Error, fmt("unable to obtain audio device {}"), name);
Log.report(logvisor::Error, FMT_STRING("unable to obtain audio device {}"), name);
return false;
}
m_device = newDevice;
@@ -486,7 +486,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
ComPtr<IMMDeviceCollection> collection;
if (FAILED(m_enumerator->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, &collection))) {
Log.report(logvisor::Error, fmt(L"unable to enumerate audio outputs"));
Log.report(logvisor::Error, FMT_STRING(L"unable to enumerate audio outputs"));
return ret;
}
@@ -518,7 +518,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
ret.reserve(numInDevices);
for (UINT i = 0; i < numInDevices; ++i) {
std::string name = fmt::format(fmt("in{}"), i);
std::string name = fmt::format(FMT_STRING("in{}"), i);
MIDIINCAPS caps;
if (FAILED(midiInGetDevCaps(i, &caps, sizeof(caps))))
@@ -534,7 +534,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
#if 0
for (UINT i=0 ; i<numOutDevices ; ++i)
{
std::string name = fmt::format(fmt("out{}"), i);
std::string name = fmt::format(FMT_STRING("out{}"), i);
MIDIOUTCAPS caps;
if (FAILED(midiOutGetDevCaps(i, &caps, sizeof(caps))))