Audio dumper: append filename with titleid and date-time
prevents overwrite of old file Co-authored-by: Megamouse <studienricky89@googlemail.com>
This commit is contained in:
@@ -1,13 +1,21 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "AudioDumper.h"
|
#include "AudioDumper.h"
|
||||||
|
|
||||||
|
#include "Utilities/date_time.h"
|
||||||
|
#include "Emu/System.h"
|
||||||
|
|
||||||
AudioDumper::AudioDumper(u16 ch)
|
AudioDumper::AudioDumper(u16 ch)
|
||||||
: m_header(ch)
|
: m_header(ch)
|
||||||
{
|
{
|
||||||
if (GetCh())
|
if (GetCh())
|
||||||
{
|
{
|
||||||
m_output.open(fs::get_cache_dir() + "audio.wav", fs::rewrite);
|
std::string path = fs::get_cache_dir() + "audio_";
|
||||||
|
if (const std::string id = Emu.GetTitleID(); !id.empty())
|
||||||
|
{
|
||||||
|
path += id + "_";
|
||||||
|
};
|
||||||
|
path += date_time::current_time_narrow<'_'>() + ".wav";
|
||||||
|
m_output.open(path, fs::rewrite);
|
||||||
m_output.write(m_header); // write initial file header
|
m_output.write(m_header); // write initial file header
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user