From debc40e85b837c205d040429267332b0f8d15fdd Mon Sep 17 00:00:00 2001 From: Chris Burgener Date: Sat, 17 Dec 2016 22:35:27 -0500 Subject: Display warning when dumping audio if file exists --- Source/Core/AudioCommon/WaveFile.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Source/Core/AudioCommon/WaveFile.cpp') diff --git a/Source/Core/AudioCommon/WaveFile.cpp b/Source/Core/AudioCommon/WaveFile.cpp index 1a9fee3319..912dc7fbf0 100644 --- a/Source/Core/AudioCommon/WaveFile.cpp +++ b/Source/Core/AudioCommon/WaveFile.cpp @@ -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) { -- cgit v1.2.3