summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/aviwrite.cpp
diff options
context:
space:
mode:
author Giuseppe Gorgoglione <gorgogsp@gmail.com>2016-07-04 13:50:10 +0200
committer Giuseppe Gorgoglione <gorgogsp@gmail.com>2016-07-04 13:50:10 +0200
commit85740d73e689ea4f19cdc924ca182a4c55f41b52 (patch)
tree9a3be48e575072fb8a74d2c2d977899b965e0900 /src/osd/modules/render/aviwrite.cpp
parent2b0682196df3cfcebadcd67f137f8802aabb27a4 (diff)
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 <snap_folder>/<device_name>/<numeric_index.avi>, 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).
Diffstat (limited to 'src/osd/modules/render/aviwrite.cpp')
-rw-r--r--src/osd/modules/render/aviwrite.cpp34
1 files changed, 13 insertions, 21 deletions
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)