From f48e3cd2ea63cb27b2ad9fe5610c72c83529cdd4 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sun, 14 Jun 2020 02:48:20 +1000 Subject: [PATCH] Re-enable A/V recording on Linux and add a big ol' disclaimer dialog --- src/BizHawk.Client.EmuHawk/MainForm.Events.cs | 34 +++++++++---------- src/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs | 3 +- src/BizHawk.Client.EmuHawk/MainForm.cs | 5 ++- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs index fa0eb2c7bf..981d0c4e26 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1,29 +1,29 @@ using System; +using System.Collections.Generic; using System.Drawing; using System.IO; using System.Windows.Forms; -using System.Collections.Generic; -using BizHawk.Emulation.Common; -using BizHawk.Emulation.Cores.Calculators; -using BizHawk.Emulation.Cores.ColecoVision; -using BizHawk.Emulation.Cores.Nintendo.NES; -using BizHawk.Emulation.Cores.Nintendo.SubNESHawk; -using BizHawk.Emulation.Cores.Nintendo.N64; -using BizHawk.Emulation.Cores.Nintendo.SNES; -using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES; using BizHawk.Client.Common; - +using BizHawk.Client.EmuHawk.CustomControls; using BizHawk.Client.EmuHawk.ToolExtensions; -using BizHawk.Emulation.Cores.Computers.AppleII; using BizHawk.Common; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Atari.A7800Hawk; -using BizHawk.Emulation.Cores.Computers.Commodore64; -using BizHawk.Emulation.Cores.Nintendo.Gameboy; -using BizHawk.Emulation.Cores.Computers.SinclairSpectrum; +using BizHawk.Emulation.Cores.Calculators; +using BizHawk.Emulation.Cores.ColecoVision; using BizHawk.Emulation.Cores.Computers.AmstradCPC; +using BizHawk.Emulation.Cores.Computers.AppleII; +using BizHawk.Emulation.Cores.Computers.Commodore64; +using BizHawk.Emulation.Cores.Computers.SinclairSpectrum; using BizHawk.Emulation.Cores.Consoles.Nintendo.NDS; +using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES; using BizHawk.Emulation.Cores.Intellivision; +using BizHawk.Emulation.Cores.Nintendo.Gameboy; +using BizHawk.Emulation.Cores.Nintendo.N64; +using BizHawk.Emulation.Cores.Nintendo.NES; +using BizHawk.Emulation.Cores.Nintendo.SNES; +using BizHawk.Emulation.Cores.Nintendo.SubNESHawk; using BizHawk.Emulation.Cores.Sony.PSX; namespace BizHawk.Client.EmuHawk @@ -288,12 +288,11 @@ namespace BizHawk.Client.EmuHawk StopAVIMenuItem.ShortcutKeyDisplayString = Config.HotkeyBindings["Stop A/V"].Bindings; CaptureOSDMenuItem.Checked = Config.AviCaptureOsd; - RecordAVMenuItem.Enabled = !OSTailoredCode.IsUnixHost && !string.IsNullOrEmpty(Config.VideoWriter) && _currAviWriter == null; - SynclessRecordingMenuItem.Enabled = !OSTailoredCode.IsUnixHost; + RecordAVMenuItem.Enabled = !string.IsNullOrEmpty(Config.VideoWriter) && _currAviWriter == null; if (_currAviWriter == null) { - ConfigAndRecordAVMenuItem.Enabled = !OSTailoredCode.IsUnixHost; + ConfigAndRecordAVMenuItem.Enabled = true; StopAVIMenuItem.Enabled = false; } else @@ -603,6 +602,7 @@ namespace BizHawk.Client.EmuHawk private void ConfigAndRecordAVMenuItem_Click(object sender, EventArgs e) { + if (OSTailoredCode.IsUnixHost) new MsgBox("Most of these options will cause crashes on Linux.", "A/V instability warning", MessageBoxIcon.Warning).ShowDialog(); RecordAv(); } diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs b/src/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs index 48dabcdfa2..4e8efe4d48 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs @@ -106,8 +106,7 @@ namespace BizHawk.Client.EmuHawk _exitRequestPending = true; break; case "Record A/V": - if (OSTailoredCode.IsUnixHost) AddOnScreenMessage("(A/V only available on Windows for now)"); - else RecordAv(); + RecordAv(); break; case "Stop A/V": StopAv(); diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 646bb4a872..cb1f52fb90 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -571,8 +571,7 @@ namespace BizHawk.Client.EmuHawk // start dumping, if appropriate if (_argParser.cmdDumpType != null && _argParser.cmdDumpName != null) { - if (OSTailoredCode.IsUnixHost) Console.WriteLine("A/V dump requires Win32 API calls, ignored"); - else RecordAv(_argParser.cmdDumpType, _argParser.cmdDumpName); + RecordAv(_argParser.cmdDumpType, _argParser.cmdDumpName); } SetMainformMovieInfo(); @@ -3148,7 +3147,7 @@ namespace BizHawk.Client.EmuHawk /// private void RecordAvBase(string videoWriterName, string filename, bool unattended) { - if (_currAviWriter != null || OSTailoredCode.IsUnixHost) return; + if (_currAviWriter != null) return; // select IVideoWriter to use IVideoWriter aw;