From bdf1838ac87f63a55f5767cc5121028982211d6b Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 28 Nov 2020 13:57:40 -0600 Subject: [PATCH] pass Config around to various AV writer and form classes, instead of using GlobalWin.Config --- src/BizHawk.Client.EmuHawk/AVOut/AVSync.cs | 10 +++++----- src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs | 20 ++++++++----------- .../AVOut/FFmpegWriter.cs | 20 +++++++++++-------- .../AVOut/FFmpegWriterForm.cs | 13 ++++++------ src/BizHawk.Client.EmuHawk/AVOut/GifWriter.cs | 17 +++++++++------- .../AVOut/GifWriterForm.cs | 13 ++++++------ .../AVOut/IVideoWriter.cs | 8 ++++---- .../AVOut/ImageSequenceWriter.cs | 5 +++-- src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs | 18 ++++++++--------- src/BizHawk.Client.EmuHawk/AVOut/NutWriter.cs | 6 +++--- .../AVOut/SynclessRecorder.cs | 5 +++-- .../AVOut/SynclessRecordingTools.cs | 10 +++++----- src/BizHawk.Client.EmuHawk/AVOut/WavWriter.cs | 10 ++++++---- src/BizHawk.Client.EmuHawk/MainForm.Events.cs | 2 +- src/BizHawk.Client.EmuHawk/MainForm.cs | 6 +++--- 15 files changed, 86 insertions(+), 77 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/AVOut/AVSync.cs b/src/BizHawk.Client.EmuHawk/AVOut/AVSync.cs index 8448072c89..b9c0dcff20 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/AVSync.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/AVSync.cs @@ -1,6 +1,6 @@ using System; using System.Windows.Forms; - +using BizHawk.Client.Common; using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk @@ -213,9 +213,9 @@ namespace BizHawk.Client.EmuHawk W.SetVideoCodecToken(token); } - public void SetDefaultVideoCodecToken() + public void SetDefaultVideoCodecToken(Config config) { - W.SetDefaultVideoCodecToken(); + W.SetDefaultVideoCodecToken(config); } public void OpenFile(string baseName) @@ -243,9 +243,9 @@ namespace BizHawk.Client.EmuHawk W.AddSamples(samples); } - public IDisposable AcquireVideoCodecToken(IWin32Window hwnd) + public IDisposable AcquireVideoCodecToken(IWin32Window hwnd, Config config) { - return W.AcquireVideoCodecToken(hwnd); + return W.AcquireVideoCodecToken(hwnd, config); } public void SetMovieParameters(int fpsNum, int fpsDen) diff --git a/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs index fe7914b6ca..11cf38efb3 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/AviWriter.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Windows.Forms; +using BizHawk.Client.Common; using BizHawk.Common; using BizHawk.Emulation.Common; @@ -257,7 +258,7 @@ namespace BizHawk.Client.EmuHawk /// Acquires a video codec configuration from the user. you may save it for future use, but you must dispose of it when you're done with it. /// returns null if the user canceled the dialog /// - public IDisposable AcquireVideoCodecToken(IWin32Window hwnd) + public IDisposable AcquireVideoCodecToken(IWin32Window hwnd, Config config) { var tempParams = new Parameters { @@ -274,7 +275,9 @@ namespace BizHawk.Client.EmuHawk File.Delete(tempfile); tempfile = Path.ChangeExtension(tempfile, "avi"); temp.OpenFile(tempfile, tempParams, null); - CodecToken token = (CodecToken)temp.AcquireVideoCodecToken(hwnd.Handle, _currVideoCodecToken); + var ret = temp.AcquireVideoCodecToken(hwnd.Handle, _currVideoCodecToken); + CodecToken token = (CodecToken)ret; + config.AviCodecToken = token?.Serialize(); temp.CloseFile(); File.Delete(tempfile); return token; @@ -733,8 +736,6 @@ namespace BizHawk.Client.EmuHawk if (result) { - // save to config and return it - GlobalWin.Config.AviCodecToken = ret.Serialize(); return ret; } @@ -963,15 +964,10 @@ namespace BizHawk.Client.EmuHawk } /// no default codec token in config - public void SetDefaultVideoCodecToken() + public void SetDefaultVideoCodecToken(Config config) { - CodecToken ct = CodecToken.DeSerialize(GlobalWin.Config.AviCodecToken); - if (ct == null) - { - throw new Exception($"No default {nameof(GlobalWin.Config.AviCodecToken)} in config!"); - } - - _currVideoCodecToken = ct; + var ct = CodecToken.DeSerialize(config.AviCodecToken); + _currVideoCodecToken = ct ?? throw new Exception($"No default {nameof(config.AviCodecToken)} in config!"); } public string DesiredExtension() diff --git a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs index 86c20fbc91..784ce619fb 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriter.cs @@ -4,6 +4,7 @@ using System.IO; using System.Text; using System.Diagnostics; using System.Windows.Forms; +using BizHawk.Client.Common; using BizHawk.Common; using BizHawk.Common.PathExtensions; using BizHawk.Emulation.Common; @@ -206,16 +207,19 @@ namespace BizHawk.Client.EmuHawk //ffmpeg.StandardInput.BaseStream.Write(b, 0, b.Length); } - public IDisposable AcquireVideoCodecToken(IWin32Window hwnd) + public IDisposable AcquireVideoCodecToken(IWin32Window hwnd, Config config) { if (new FFmpegService().QueryServiceAvailable()) - return FFmpegWriterForm.DoFFmpegWriterDlg(hwnd); - else { - FFmpegDownloaderForm.Run(hwnd); - if (new FFmpegService().QueryServiceAvailable()) - return FFmpegWriterForm.DoFFmpegWriterDlg(hwnd); + return FFmpegWriterForm.DoFFmpegWriterDlg(hwnd, config); } + + FFmpegDownloaderForm.Run(hwnd); + if (new FFmpegService().QueryServiceAvailable()) + { + return FFmpegWriterForm.DoFFmpegWriterDlg(hwnd, config); + } + return null; } @@ -317,9 +321,9 @@ namespace BizHawk.Client.EmuHawk return _token.Extension; } - public void SetDefaultVideoCodecToken() + public void SetDefaultVideoCodecToken(Config config) { - _token = FFmpegWriterForm.FormatPreset.GetDefaultPreset(); + _token = FFmpegWriterForm.FormatPreset.GetDefaultPreset(config.FFmpegFormat); } public bool UsesAudio => true; diff --git a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriterForm.cs b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriterForm.cs index 6b3a0a2bef..5a0599d84e 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriterForm.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/FFmpegWriterForm.cs @@ -1,5 +1,6 @@ using System; using System.Windows.Forms; +using BizHawk.Client.Common; namespace BizHawk.Client.EmuHawk { @@ -75,13 +76,13 @@ namespace BizHawk.Client.EmuHawk /// /// get the default format preset (from config files) /// - public static FormatPreset GetDefaultPreset() + public static FormatPreset GetDefaultPreset(string ffmpegFormat) { FormatPreset[] fps = GetPresets(); foreach (var fp in fps) { - if (fp.ToString() == GlobalWin.Config.FFmpegFormat) + if (fp.ToString() == ffmpegFormat) { if (fp.Custom) { @@ -148,12 +149,12 @@ namespace BizHawk.Client.EmuHawk /// /// return a FormatPreset corresponding to the user's choice /// - public static FormatPreset DoFFmpegWriterDlg(IWin32Window owner) + public static FormatPreset DoFFmpegWriterDlg(IWin32Window owner, Config config) { FFmpegWriterForm dlg = new FFmpegWriterForm(); dlg.listBox1.Items.AddRange(FormatPreset.GetPresets()); - int i = dlg.listBox1.FindStringExact(GlobalWin.Config.FFmpegFormat); + int i = dlg.listBox1.FindStringExact(config.FFmpegFormat); if (i != ListBox.NoMatches) { dlg.listBox1.SelectedIndex = i; @@ -169,11 +170,11 @@ namespace BizHawk.Client.EmuHawk else { ret = (FormatPreset)dlg.listBox1.SelectedItem; - GlobalWin.Config.FFmpegFormat = ret.ToString(); + config.FFmpegFormat = ret.ToString(); if (ret.Custom) { ret.Commandline = - GlobalWin.Config.FFmpegCustomCommand = + config.FFmpegCustomCommand = dlg.textBox1.Text; ret.DeduceFormat(ret.Commandline); diff --git a/src/BizHawk.Client.EmuHawk/AVOut/GifWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/GifWriter.cs index bb70b0059e..192f2996ce 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/GifWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/GifWriter.cs @@ -1,6 +1,9 @@ using System; using System.IO; using System.Drawing; +using System.Windows.Forms; + +using BizHawk.Client.Common; using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk @@ -58,12 +61,12 @@ namespace BizHawk.Client.EmuHawk } } - public static GifToken LoadFromConfig() + public static GifToken LoadFromConfig(Config config) { return new GifToken(0, 0) { - Frameskip = GlobalWin.Config.GifWriterFrameskip, - FrameDelay = GlobalWin.Config.GifWriterDelay + Frameskip = config.GifWriterFrameskip, + FrameDelay = config.GifWriterDelay }; } @@ -94,9 +97,9 @@ namespace BizHawk.Client.EmuHawk } } - public void SetDefaultVideoCodecToken() + public void SetDefaultVideoCodecToken(Config config) { - _token = GifToken.LoadFromConfig(); + _token = GifToken.LoadFromConfig(config); CalcDelay(); } @@ -192,9 +195,9 @@ namespace BizHawk.Client.EmuHawk // ignored } - public IDisposable AcquireVideoCodecToken(System.Windows.Forms.IWin32Window hwnd) + public IDisposable AcquireVideoCodecToken(IWin32Window hwnd, Config config) { - return GifWriterForm.DoTokenForm(hwnd); + return GifWriterForm.DoTokenForm(hwnd, config); } private void CalcDelay() diff --git a/src/BizHawk.Client.EmuHawk/AVOut/GifWriterForm.cs b/src/BizHawk.Client.EmuHawk/AVOut/GifWriterForm.cs index c8ee465270..02ae1da861 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/GifWriterForm.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/GifWriterForm.cs @@ -1,5 +1,6 @@ using System; using System.Windows.Forms; +using BizHawk.Client.Common; namespace BizHawk.Client.EmuHawk { @@ -10,22 +11,22 @@ namespace BizHawk.Client.EmuHawk InitializeComponent(); } - public static GifWriter.GifToken DoTokenForm(IWin32Window parent) + public static GifWriter.GifToken DoTokenForm(IWin32Window parent, Config config) { using var dlg = new GifWriterForm { - numericUpDown1 = { Value = GlobalWin.Config.GifWriterFrameskip }, - numericUpDown2 = { Value = GlobalWin.Config.GifWriterDelay } + numericUpDown1 = { Value = config.GifWriterFrameskip }, + numericUpDown2 = { Value = config.GifWriterDelay } }; dlg.NumericUpDown2_ValueChanged(null, null); var result = dlg.ShowDialog(parent); if (result.IsOk()) { - GlobalWin.Config.GifWriterFrameskip = (int)dlg.numericUpDown1.Value; - GlobalWin.Config.GifWriterDelay = (int)dlg.numericUpDown2.Value; + config.GifWriterFrameskip = (int)dlg.numericUpDown1.Value; + config.GifWriterDelay = (int)dlg.numericUpDown2.Value; - return GifWriter.GifToken.LoadFromConfig(); + return GifWriter.GifToken.LoadFromConfig(config); } return null; diff --git a/src/BizHawk.Client.EmuHawk/AVOut/IVideoWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/IVideoWriter.cs index 0a59ad7001..7767a84090 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/IVideoWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/IVideoWriter.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; - -using BizHawk.Common; +using System.Windows.Forms; +using BizHawk.Client.Common; using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk @@ -16,7 +16,7 @@ namespace BizHawk.Client.EmuHawk /// /// sets to a default video codec token without calling any UI - for automated dumping /// - void SetDefaultVideoCodecToken(); + void SetDefaultVideoCodecToken(Config config); /// /// Returns whether this VideoWriter dumps audio @@ -64,7 +64,7 @@ namespace BizHawk.Client.EmuHawk /// /// hwnd to attach to if the user is shown config dialog /// codec token, dispose of it when you're done with it - IDisposable AcquireVideoCodecToken(System.Windows.Forms.IWin32Window hwnd); + IDisposable AcquireVideoCodecToken(IWin32Window hwnd, Config config); /// /// set framerate to fpsNum/fpsDen (assumed to be unchanging over the life of the stream) diff --git a/src/BizHawk.Client.EmuHawk/AVOut/ImageSequenceWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/ImageSequenceWriter.cs index 3cc1242cef..94d805249e 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/ImageSequenceWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/ImageSequenceWriter.cs @@ -4,6 +4,7 @@ using System.Drawing.Imaging; using System.Windows.Forms; using BizHawk.Bizware.BizwareGL; +using BizHawk.Client.Common; using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk @@ -21,7 +22,7 @@ namespace BizHawk.Client.EmuHawk { } - public void SetDefaultVideoCodecToken() + public void SetDefaultVideoCodecToken(Config config) { } @@ -72,7 +73,7 @@ namespace BizHawk.Client.EmuHawk } } - public IDisposable AcquireVideoCodecToken(IWin32Window hwnd) + public IDisposable AcquireVideoCodecToken(IWin32Window hwnd, Config config) { return new CodecToken(); } diff --git a/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs index 3801d1f89e..1890cd98b1 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/JMDWriter.cs @@ -5,7 +5,7 @@ using System.IO; using System.Text; using System.Threading; using System.Windows.Forms; - +using BizHawk.Client.Common; using ICSharpCode.SharpZipLib.Zip.Compression.Streams; using ICSharpCode.SharpZipLib.Zip.Compression; @@ -529,20 +529,20 @@ namespace BizHawk.Client.EmuHawk /// /// hwnd to attach to if the user is shown config dialog /// codec token, dispose of it when you're done with it - public IDisposable AcquireVideoCodecToken(IWin32Window hwnd) + public IDisposable AcquireVideoCodecToken(IWin32Window hwnd, Config config) { var ret = new CodecToken(); // load from config and sanitize - int t = Math.Min(Math.Max(GlobalWin.Config.JmdThreads, 1), 6); + int t = Math.Min(Math.Max(config.JmdThreads, 1), 6); - int c = Math.Min(Math.Max(GlobalWin.Config.JmdCompression, Deflater.NO_COMPRESSION), Deflater.BEST_COMPRESSION); + int c = Math.Min(Math.Max(config.JmdCompression, Deflater.NO_COMPRESSION), Deflater.BEST_COMPRESSION); if (!JmdForm.DoCompressionDlg(ref t, ref c, 1, 6, Deflater.NO_COMPRESSION, Deflater.BEST_COMPRESSION, hwnd)) return null; - GlobalWin.Config.JmdThreads = ret.NumThreads = t; - GlobalWin.Config.JmdCompression = ret.CompressionLevel = c; + config.JmdThreads = ret.NumThreads = t; + config.JmdCompression = ret.CompressionLevel = c; return ret; } @@ -778,14 +778,14 @@ namespace BizHawk.Client.EmuHawk public string DesiredExtension() => "jmd"; - public void SetDefaultVideoCodecToken() + public void SetDefaultVideoCodecToken(Config config) { CodecToken ct = new CodecToken(); // load from config and sanitize - int t = Math.Min(Math.Max(GlobalWin.Config.JmdThreads, 1), 6); + int t = Math.Min(Math.Max(config.JmdThreads, 1), 6); - int c = Math.Min(Math.Max(GlobalWin.Config.JmdCompression, Deflater.NO_COMPRESSION), Deflater.BEST_COMPRESSION); + int c = Math.Min(Math.Max(config.JmdCompression, Deflater.NO_COMPRESSION), Deflater.BEST_COMPRESSION); ct.CompressionLevel = c; ct.NumThreads = t; diff --git a/src/BizHawk.Client.EmuHawk/AVOut/NutWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/NutWriter.cs index db577b42be..98b983b185 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/NutWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/NutWriter.cs @@ -1,7 +1,7 @@ using System; using System.IO; using System.Windows.Forms; - +using BizHawk.Client.Common; using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk @@ -29,7 +29,7 @@ namespace BizHawk.Client.EmuHawk { // ignored } - public IDisposable AcquireVideoCodecToken(IWin32Window hwnd) + public IDisposable AcquireVideoCodecToken(IWin32Window hwnd, Config config) { return new NutWriterToken(); } @@ -137,7 +137,7 @@ namespace BizHawk.Client.EmuHawk public string DesiredExtension() => "nut"; - public void SetDefaultVideoCodecToken() + public void SetDefaultVideoCodecToken(Config config) { // ignored } diff --git a/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecorder.cs b/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecorder.cs index a2d5a9beb0..1d659654db 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecorder.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecorder.cs @@ -7,6 +7,7 @@ using System.Windows.Forms; using BizHawk.Emulation.Common; using BizHawk.Bizware.BizwareGL; +using BizHawk.Client.Common; namespace BizHawk.Client.EmuHawk { @@ -21,7 +22,7 @@ namespace BizHawk.Client.EmuHawk { } - public void SetDefaultVideoCodecToken() + public void SetDefaultVideoCodecToken(Config config) { } @@ -82,7 +83,7 @@ namespace BizHawk.Client.EmuHawk } } - public IDisposable AcquireVideoCodecToken(IWin32Window hwnd) + public IDisposable AcquireVideoCodecToken(IWin32Window hwnd, Config config) { return new DummyDisposable(); } diff --git a/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs b/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs index 3d7ad27f89..5c58535df5 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs @@ -13,16 +13,16 @@ namespace BizHawk.Client.EmuHawk public partial class SynclessRecordingTools : Form { private readonly List _mFrameInfos = new List(); + private readonly Config _config; private readonly IGameInfo _game; - private readonly string _avAbsolutePath; private string _mSynclessConfigFile; private string _mFramesDirectory; - public SynclessRecordingTools(IGameInfo game, string avAbsolutePath) + public SynclessRecordingTools(Config config, IGameInfo game) { + _config = config; _game = game; - _avAbsolutePath = avAbsolutePath; InitializeComponent(); } @@ -31,7 +31,7 @@ namespace BizHawk.Client.EmuHawk var ofd = new OpenFileDialog { FileName = $"{_game.FilesystemSafeName()}.syncless.txt", - InitialDirectory = _avAbsolutePath + InitialDirectory = _config.PathEntries.AvAbsolutePath() }; if (ofd.ShowDialog() == DialogResult.Cancel) @@ -123,7 +123,7 @@ namespace BizHawk.Client.EmuHawk avw.SetAudioParameters(44100, 2, 16); // hacky avw.SetMovieParameters(60, 1); // hacky avw.SetVideoParameters(width, height); - var token = avw.AcquireVideoCodecToken(this); + var token = avw.AcquireVideoCodecToken(this, _config); avw.SetVideoCodecToken(token); avw.OpenFile(sfd.FileName); foreach (var fi in _mFrameInfos) diff --git a/src/BizHawk.Client.EmuHawk/AVOut/WavWriter.cs b/src/BizHawk.Client.EmuHawk/AVOut/WavWriter.cs index 7dd008ba7f..0ea17ed025 100644 --- a/src/BizHawk.Client.EmuHawk/AVOut/WavWriter.cs +++ b/src/BizHawk.Client.EmuHawk/AVOut/WavWriter.cs @@ -2,7 +2,9 @@ using System.Collections.Generic; using System.Text; using System.IO; +using System.Windows.Forms; +using BizHawk.Client.Common; using BizHawk.Common.IOExtensions; using BizHawk.Emulation.Common; @@ -227,7 +229,7 @@ namespace BizHawk.Client.EmuHawk public void Dispose() { } } - public IDisposable AcquireVideoCodecToken(System.Windows.Forms.IWin32Window hwnd) + public IDisposable AcquireVideoCodecToken(IWin32Window hwnd, Config config) { // don't care return new WavWriterVToken(); @@ -236,8 +238,8 @@ namespace BizHawk.Client.EmuHawk /// is not 16 public void SetAudioParameters(int sampleRate, int channels, int bits) { - this._sampleRate = sampleRate; - this._channels = channels; + _sampleRate = sampleRate; + _channels = channels; if (bits != 16) { throw new ArgumentException("Only support 16bit audio!"); @@ -294,7 +296,7 @@ namespace BizHawk.Client.EmuHawk public string DesiredExtension() => "wav"; - public void SetDefaultVideoCodecToken() + public void SetDefaultVideoCodecToken(Config config) { // don't use codec tokens, so don't care } diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs index 11ab617170..d2a2e4f3cb 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -540,7 +540,7 @@ namespace BizHawk.Client.EmuHawk private void SynclessRecordingMenuItem_Click(object sender, EventArgs e) { - new SynclessRecordingTools(Game, Config.PathEntries.AvAbsolutePath()).Run(); + new SynclessRecordingTools(Config, Game).Run(); } private void CaptureOSDMenuItem_Click(object sender, EventArgs e) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index dbf7fb3981..eeb90f8b2c 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -3183,7 +3183,7 @@ namespace BizHawk.Client.EmuHawk // do this before save dialog because ffmpeg won't know what extension it wants until it's been configured if (unattended && !string.IsNullOrEmpty(filename)) { - aw.SetDefaultVideoCodecToken(); + aw.SetDefaultVideoCodecToken(Config); } else { @@ -3191,10 +3191,10 @@ namespace BizHawk.Client.EmuHawk // PLEASE REDO ME TO NOT CARE WHICH AVWRITER IS USED! if (usingAvi && !string.IsNullOrEmpty(Config.AviCodecToken)) { - aw.SetDefaultVideoCodecToken(); + aw.SetDefaultVideoCodecToken(Config); } - var token = aw.AcquireVideoCodecToken(this); + var token = aw.AcquireVideoCodecToken(this, Config); if (token == null) { AddOnScreenMessage("A/V capture canceled.");