Skip to content

Commit

Permalink
Add Silent Audio Dumping INI Option
Browse files Browse the repository at this point in the history
  • Loading branch information
RisingFog committed Jan 8, 2017
1 parent 358de1e commit eec67be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/Core/AudioCommon/WaveFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"

#include "Core/ConfigManager.h"

constexpr size_t WaveFileWriter::BUFFER_SIZE;

WaveFileWriter::WaveFileWriter()
Expand All @@ -27,7 +29,7 @@ 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);
}
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Core/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eec67be

Please sign in to comment.