diff options
| author | Chris Burgener <christhecoolist@gmail.com> | 2016-12-17 22:35:27 -0500 |
|---|---|---|
| committer | Chris Burgener <christhecoolist@gmail.com> | 2016-12-17 22:45:01 -0500 |
| commit | debc40e85b837c205d040429267332b0f8d15fdd (patch) | |
| tree | d2a39eba41ba3e379038449d8ca8cbf5475a1e14 /Source/Core/AudioCommon/WaveFile.cpp | |
| parent | f431b18675fc2df846a1d142c1d7a793bd1d1175 (diff) | |
Display warning when dumping audio if file exists
Diffstat (limited to 'Source/Core/AudioCommon/WaveFile.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/WaveFile.cpp | 14 |
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) { |
