summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/WaveFile.cpp
diff options
context:
space:
mode:
authorAnthony <Helios747@users.noreply.github.com>2017-01-01 17:20:39 -0800
committerGitHub <noreply@github.com>2017-01-01 17:20:39 -0800
commita7f7ccc9d21b57cd900b6104deafcc465ff2d5b3 (patch)
tree3bb8be02dfb17ba65909d8b6bd90e59632ae528a /Source/Core/AudioCommon/WaveFile.cpp
parentb10a0de76965ff5225234c6eb4ababb38c48147a (diff)
parentdebc40e85b837c205d040429267332b0f8d15fdd (diff)
Merge pull request #4523 from RisingFog/overwrite_audio_warning
Display warning when dumping audio if file exists
Diffstat (limited to 'Source/Core/AudioCommon/WaveFile.cpp')
-rw-r--r--Source/Core/AudioCommon/WaveFile.cpp14
1 files changed, 14 insertions, 0 deletions
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)
{