Skip to content

Commit

Permalink
AudioCommon: Convert alerts over to fmt-based variants
Browse files Browse the repository at this point in the history
Continues the migration over to fmt
  • Loading branch information
lioncash committed Nov 27, 2020
1 parent 9b03cdf commit db89fd0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Source/Core/AudioCommon/OpenALStream.cpp
Expand Up @@ -96,7 +96,7 @@ bool OpenALStream::Init()
{
if (!palcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT"))
{
PanicAlertT("OpenAL: can't find sound devices");
PanicAlertFmtT("OpenAL: can't find sound devices");
return false;
}

Expand All @@ -106,15 +106,15 @@ bool OpenALStream::Init()
ALCdevice* device = palcOpenDevice(default_device_dame);
if (!device)
{
PanicAlertT("OpenAL: can't open device %s", default_device_dame);
PanicAlertFmtT("OpenAL: can't open device {0}", default_device_dame);
return false;
}

ALCcontext* context = palcCreateContext(device, nullptr);
if (!context)
{
palcCloseDevice(device);
PanicAlertT("OpenAL: can't create context for device %s", default_device_dame);
PanicAlertFmtT("OpenAL: can't create context for device {0}", default_device_dame);
return false;
}

Expand Down
18 changes: 9 additions & 9 deletions Source/Core/AudioCommon/WaveFile.cpp
Expand Up @@ -31,7 +31,7 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa
if (File::Exists(filename))
{
if (SConfig::GetInstance().m_DumpAudioSilent ||
AskYesNoT("Delete the existing file '%s'?", filename.c_str()))
AskYesNoFmtT("Delete the existing file '{0}'?", filename))
{
File::Delete(filename);
}
Expand All @@ -45,17 +45,17 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa
// Check if the file is already open
if (file)
{
PanicAlertT("The file %s was already open, the file header will not be written.",
filename.c_str());
PanicAlertFmtT("The file {0} was already open, the file header will not be written.", filename);
return false;
}

file.Open(filename, "wb");
if (!file)
{
PanicAlertT("The file %s could not be opened for writing. Please check if it's already opened "
"by another program.",
filename.c_str());
PanicAlertFmtT(
"The file {0} could not be opened for writing. Please check if it's already opened "
"by another program.",
filename);
return false;
}

Expand Down Expand Up @@ -87,7 +87,7 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa

// We are now at offset 44
if (file.Tell() != 44)
PanicAlert("Wrong offset: %lld", (long long)file.Tell());
PanicAlertFmt("Wrong offset: {}", file.Tell());

return true;
}
Expand Down Expand Up @@ -117,10 +117,10 @@ void WaveFileWriter::Write4(const char* ptr)
void WaveFileWriter::AddStereoSamplesBE(const short* sample_data, u32 count, int sample_rate)
{
if (!file)
PanicAlertT("WaveFileWriter - file not open.");
PanicAlertFmtT("WaveFileWriter - file not open.");

if (count > BUFFER_SIZE * 2)
PanicAlert("WaveFileWriter - buffer too small (count = %u).", count);
PanicAlertFmt("WaveFileWriter - buffer too small (count = {}).", count);

if (skip_silence)
{
Expand Down

0 comments on commit db89fd0

Please sign in to comment.