mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-09 21:47:57 +00:00
General: Correct fmt specifiers
Corrects a few fmt calls to use fmt's specifiers. This also converts instances of printf over to fmt::print
This commit is contained in:
@@ -73,7 +73,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
argSize = sizeof(devId);
|
||||
if (AudioObjectGetPropertyData(kAudioObjectSystemObject, &propertyAddress, sizeof(devName), &devName, &argSize,
|
||||
&devId) != noErr) {
|
||||
Log.report(logvisor::Error, fmt("unable to resolve audio device UID %s, using default"),
|
||||
Log.report(logvisor::Error, fmt("unable to resolve audio device UID {}, using default"),
|
||||
CFStringGetCStringPtr(devName, kCFStringEncodingUTF8));
|
||||
argSize = sizeof(devId);
|
||||
propertyAddress.mSelector = kAudioHardwarePropertyDefaultOutputDevice;
|
||||
@@ -758,7 +758,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
chMapOut.m_channels[4] = AudioChannel::FrontCenter;
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Warning, fmt("unknown channel layout %u; using stereo"), layout.mChannelLayoutTag);
|
||||
Log.report(logvisor::Warning, fmt("unknown channel layout {}; using stereo"), layout.mChannelLayoutTag);
|
||||
chMapOut.m_channelCount = 2;
|
||||
chMapOut.m_channels[0] = AudioChannel::FrontLeft;
|
||||
chMapOut.m_channels[1] = AudioChannel::FrontRight;
|
||||
|
||||
@@ -259,12 +259,12 @@ LtRtProcessing::LtRtProcessing(int _5msFrames, const AudioVoiceEngineMixInfo& mi
|
||||
template <typename T>
|
||||
void LtRtProcessing::Process(const T* input, T* output, int frameCount) {
|
||||
#if 0
|
||||
for (int i=0 ; i<frameCount ; ++i)
|
||||
{
|
||||
output[i * 2] = input[i * 5 + 3];
|
||||
output[i * 2 + 1] = input[i * 5 + 4];
|
||||
}
|
||||
return;
|
||||
for (int i=0 ; i<frameCount ; ++i)
|
||||
{
|
||||
output[i * 2] = input[i * 5 + 3];
|
||||
output[i * 2 + 1] = input[i * 5 + 4];
|
||||
}
|
||||
return;
|
||||
#endif
|
||||
|
||||
int outFramesRem = frameCount;
|
||||
@@ -273,14 +273,14 @@ void LtRtProcessing::Process(const T* input, T* output, int frameCount) {
|
||||
int tail = std::min(m_windowFrames * 2, m_bufferTail + frameCount);
|
||||
int samples = (tail - m_bufferTail) * 5;
|
||||
memmove(&inBuf[m_bufferTail * 5], input, samples * sizeof(T));
|
||||
// printf("input %d to %d\n", tail - m_bufferTail, m_bufferTail);
|
||||
// fmt::print("input {} to {}\n", tail - m_bufferTail, m_bufferTail);
|
||||
input += samples;
|
||||
frameCount -= tail - m_bufferTail;
|
||||
|
||||
int head = std::min(m_windowFrames * 2, m_bufferHead + outFramesRem);
|
||||
samples = (head - m_bufferHead) * 2;
|
||||
memmove(output, outBuf + m_bufferHead * 2, samples * sizeof(T));
|
||||
// printf("output %d from %d\n", head - m_bufferHead, m_bufferHead);
|
||||
// fmt::print("output {} from {}\n", head - m_bufferHead, m_bufferHead);
|
||||
output += samples;
|
||||
outFramesRem -= head - m_bufferHead;
|
||||
|
||||
@@ -300,7 +300,7 @@ void LtRtProcessing::Process(const T* input, T* output, int frameCount) {
|
||||
for (int i = 0; i < m_windowFrames; ++i, ++delayI) {
|
||||
out[i * 2] = ClampFull<T>(in[delayI * 5] + 0.7071068f * in[delayI * 5 + 2]);
|
||||
out[i * 2 + 1] = ClampFull<T>(in[delayI * 5 + 1] + 0.7071068f * in[delayI * 5 + 2]);
|
||||
// printf("in %d out %d\n", bufIdx * m_5msFrames + delayI, bufIdx * m_5msFrames + i);
|
||||
// fmt::print("in {} out {}\n", bufIdx * m_5msFrames + delayI, bufIdx * m_5msFrames + i);
|
||||
}
|
||||
} else {
|
||||
int delayI = m_windowFrames * 2 - m_halfFrames;
|
||||
@@ -308,13 +308,13 @@ void LtRtProcessing::Process(const T* input, T* output, int frameCount) {
|
||||
for (i = 0; i < m_halfFrames; ++i, ++delayI) {
|
||||
out[i * 2] = ClampFull<T>(in[delayI * 5] + 0.7071068f * in[delayI * 5 + 2]);
|
||||
out[i * 2 + 1] = ClampFull<T>(in[delayI * 5 + 1] + 0.7071068f * in[delayI * 5 + 2]);
|
||||
// printf("in %d out %d\n", bufIdx * m_5msFrames + delayI, bufIdx * m_5msFrames + i);
|
||||
// fmt::print("in {} out {}\n", bufIdx * m_5msFrames + delayI, bufIdx * m_5msFrames + i);
|
||||
}
|
||||
delayI = 0;
|
||||
for (; i < m_windowFrames; ++i, ++delayI) {
|
||||
out[i * 2] = ClampFull<T>(in[delayI * 5] + 0.7071068f * in[delayI * 5 + 2]);
|
||||
out[i * 2 + 1] = ClampFull<T>(in[delayI * 5 + 1] + 0.7071068f * in[delayI * 5 + 2]);
|
||||
// printf("in %d out %d\n", bufIdx * m_5msFrames + delayI, bufIdx * m_5msFrames + i);
|
||||
// fmt::print("in {} out {}\n", bufIdx * m_5msFrames + delayI, bufIdx * m_5msFrames + i);
|
||||
}
|
||||
}
|
||||
#if INTEL_IPP
|
||||
@@ -328,14 +328,14 @@ void LtRtProcessing::Process(const T* input, T* output, int frameCount) {
|
||||
if (frameCount) {
|
||||
samples = frameCount * 5;
|
||||
memmove(inBuf, input, samples * sizeof(T));
|
||||
// printf("input %d to %d\n", frameCount, 0);
|
||||
// fmt::print("input {} to {}\n", frameCount, 0);
|
||||
m_bufferTail = frameCount;
|
||||
}
|
||||
|
||||
if (outFramesRem) {
|
||||
samples = outFramesRem * 2;
|
||||
memmove(output, outBuf, samples * sizeof(T));
|
||||
// printf("output %d from %d\n", outFramesRem, 0);
|
||||
// fmt::print("output {} from {}\n", outFramesRem, 0);
|
||||
m_bufferHead = outFramesRem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ 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 %s"), m_sinkName);
|
||||
Log.report(logvisor::Error, fmt("unable to obtain audio device {}"), m_sinkName);
|
||||
m_device.Reset();
|
||||
return;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
|
||||
chMapOut.m_channels[7] = AudioChannel::SideRight;
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Warning, fmt("unknown channel layout %u; using stereo"), pwfx->Format.nChannels);
|
||||
Log.report(logvisor::Warning, fmt("unknown channel layout {}; using stereo"), pwfx->Format.nChannels);
|
||||
chMapOut.m_channelCount = 2;
|
||||
chMapOut.m_channels[0] = AudioChannel::FrontLeft;
|
||||
chMapOut.m_channels[1] = AudioChannel::FrontRight;
|
||||
|
||||
Reference in New Issue
Block a user