Display warning when dumping audio if file exists

This commit is contained in:
Chris Burgener
2016-12-17 22:35:27 -05:00
parent f431b18675
commit debc40e85b
2 changed files with 38 additions and 8 deletions

View File

@ -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)
{