From 47b3a9c68ed1cc2879a4af3938c40022d36fa79b Mon Sep 17 00:00:00 2001 From: Chris Burgener Date: Sun, 8 Jan 2017 13:51:00 -0500 Subject: [PATCH] Add Silent Audio Dumping INI Option --- Source/Core/AudioCommon/WaveFile.cpp | 5 ++++- Source/Core/Core/ConfigManager.cpp | 2 ++ Source/Core/Core/ConfigManager.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/AudioCommon/WaveFile.cpp b/Source/Core/AudioCommon/WaveFile.cpp index 912dc7fbf0..c7013f10ae 100644 --- a/Source/Core/AudioCommon/WaveFile.cpp +++ b/Source/Core/AudioCommon/WaveFile.cpp @@ -11,6 +11,8 @@ #include "Common/MsgHandler.h" #include "Common/StringUtil.h" +#include "Core/ConfigManager.h" + constexpr size_t WaveFileWriter::BUFFER_SIZE; WaveFileWriter::WaveFileWriter() @@ -27,7 +29,8 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa // Ask to delete file if (File::Exists(filename)) { - if (AskYesNoT("Delete the existing file '%s'?", filename.c_str())) + if (SConfig::GetInstance().m_DumpAudioSilent || + AskYesNoT("Delete the existing file '%s'?", filename.c_str())) { File::Delete(filename); } diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index 40b4019676..f26385f4eb 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -322,6 +322,7 @@ void SConfig::SaveDSPSettings(IniFile& ini) dsp->Set("EnableJIT", m_DSPEnableJIT); dsp->Set("DumpAudio", m_DumpAudio); + dsp->Set("DumpAudioSilent", m_DumpAudioSilent); dsp->Set("DumpUCode", m_DumpUCode); dsp->Set("Backend", sBackend); dsp->Set("Volume", m_Volume); @@ -643,6 +644,7 @@ void SConfig::LoadDSPSettings(IniFile& ini) dsp->Get("EnableJIT", &m_DSPEnableJIT, true); dsp->Get("DumpAudio", &m_DumpAudio, false); + dsp->Get("DumpAudioSilent", &m_DumpAudioSilent, false); dsp->Get("DumpUCode", &m_DumpUCode, false); #if defined __linux__ && HAVE_ALSA dsp->Get("Backend", &sBackend, BACKEND_ALSA); diff --git a/Source/Core/Core/ConfigManager.h b/Source/Core/Core/ConfigManager.h index b3c8ce540a..8bc3d9676a 100644 --- a/Source/Core/Core/ConfigManager.h +++ b/Source/Core/Core/ConfigManager.h @@ -298,6 +298,7 @@ struct SConfig : NonCopyable bool m_DSPEnableJIT; bool m_DSPCaptureLog; bool m_DumpAudio; + bool m_DumpAudioSilent; bool m_IsMuted; bool m_DumpUCode; int m_Volume;