Merge pull request #4633 from RisingFog/silent_audio_dumping

Add Silent Audio Dumping INI Option
This commit is contained in:
Anthony 2017-01-08 11:05:59 -08:00 committed by GitHub
commit f78eb48876
3 changed files with 7 additions and 1 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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;