mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Merge pull request #4523 from RisingFog/overwrite_audio_warning
Display warning when dumping audio if file exists
This commit is contained in:
commit
a7f7ccc9d2
@ -214,10 +214,18 @@ void CMixer::StartLogDTKAudio(const std::string& filename)
|
||||
{
|
||||
if (!m_log_dtk_audio)
|
||||
{
|
||||
m_log_dtk_audio = true;
|
||||
m_wave_writer_dtk.Start(filename, m_streaming_mixer.GetInputSampleRate());
|
||||
m_wave_writer_dtk.SetSkipSilence(false);
|
||||
NOTICE_LOG(AUDIO, "Starting DTK Audio logging");
|
||||
bool success = m_wave_writer_dtk.Start(filename, m_streaming_mixer.GetInputSampleRate());
|
||||
if (success)
|
||||
{
|
||||
m_log_dtk_audio = true;
|
||||
m_wave_writer_dtk.SetSkipSilence(false);
|
||||
NOTICE_LOG(AUDIO, "Starting DTK Audio logging");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_wave_writer_dtk.Stop();
|
||||
NOTICE_LOG(AUDIO, "Unable to start DTK Audio logging");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -243,10 +251,18 @@ void CMixer::StartLogDSPAudio(const std::string& filename)
|
||||
{
|
||||
if (!m_log_dsp_audio)
|
||||
{
|
||||
m_log_dsp_audio = true;
|
||||
m_wave_writer_dsp.Start(filename, m_dma_mixer.GetInputSampleRate());
|
||||
m_wave_writer_dsp.SetSkipSilence(false);
|
||||
NOTICE_LOG(AUDIO, "Starting DSP Audio logging");
|
||||
bool success = m_wave_writer_dsp.Start(filename, m_dma_mixer.GetInputSampleRate());
|
||||
if (success)
|
||||
{
|
||||
m_log_dsp_audio = true;
|
||||
m_wave_writer_dsp.SetSkipSilence(false);
|
||||
NOTICE_LOG(AUDIO, "Starting DSP Audio logging");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_wave_writer_dsp.Stop();
|
||||
NOTICE_LOG(AUDIO, "Unable to start DSP Audio logging");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -24,6 +24,20 @@ WaveFileWriter::~WaveFileWriter()
|
||||
|
||||
bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRate)
|
||||
{
|
||||
// Ask to delete file
|
||||
if (File::Exists(filename))
|
||||
{
|
||||
if (AskYesNoT("Delete the existing file '%s'?", filename.c_str()))
|
||||
{
|
||||
File::Delete(filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Stop and cancel dumping the audio
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the file is already open
|
||||
if (file)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user