From 85740d73e689ea4f19cdc924ca182a4c55f41b52 Mon Sep 17 00:00:00 2001 From: Giuseppe Gorgoglione Date: Mon, 4 Jul 2016 13:50:10 +0200 Subject: Remove bgfx_avi_name and hlsl_write options Now the filenames for movies recorded by HLSL and BGFX renderers are automatically generated just like the ones for movies and snapshots recorded by the video core. They are generated according to the "snapname" template (eg. by default //, so you can revert to the old behavior (why?) just setting "snapname bgfx.avi" or "snapname hlsl.avi". The main advantage is that now you can record as many movies as you want during a single gaming session without much hassle (previously you had to move or rename the old movie file by hand before recording a new one). --- src/osd/modules/render/aviwrite.cpp | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'src/osd/modules/render/aviwrite.cpp') diff --git a/src/osd/modules/render/aviwrite.cpp b/src/osd/modules/render/aviwrite.cpp index 9ff7c5ab17d..38bc55f1c0c 100644 --- a/src/osd/modules/render/aviwrite.cpp +++ b/src/osd/modules/render/aviwrite.cpp @@ -27,17 +27,14 @@ avi_write::~avi_write() } } -void avi_write::record(std::string name) +void avi_write::record() { if (m_recording) { end_avi_recording(); } - if (name != "") - { - begin_avi_recording(name); - } + begin_avi_recording(); } void avi_write::stop() @@ -46,7 +43,7 @@ void avi_write::stop() end_avi_recording(); } -void avi_write::begin_avi_recording(std::string name) +void avi_write::begin_avi_recording() { // stop any existing recording end_avi_recording(); @@ -73,25 +70,20 @@ void avi_write::begin_avi_recording(std::string name) info.audio_samplebits = 16; info.audio_samplerate = m_machine.sample_rate(); - // create a new temporary movie file - osd_file::error filerr; - std::string fullpath; - { - emu_file tempfile(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - filerr = tempfile.open(name.c_str()); - - // compute the frame time - m_frame_period = attotime::from_seconds(1000) / info.video_timescale; + // compute the frame time + m_frame_period = attotime::from_seconds(1000) / info.video_timescale; - // if we succeeded, make a copy of the name and create the real file over top - if (filerr == osd_file::error::NONE) - { - fullpath = tempfile.fullpath(); - } - } + // create a new temporary movie file + emu_file tempfile(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); + + osd_file::error filerr = m_machine.video().open_next(tempfile, "avi"); + // if we succeeded, make a copy of the name and create the real file over top if (filerr == osd_file::error::NONE) { + std::string fullpath = tempfile.fullpath(); + tempfile.close(); + // create the file and free the string avi_file::error avierr = avi_file::create(fullpath, info, m_output_file); if (avierr != avi_file::error::NONE) -- cgit v1.2.3-70-g09d2