From 04b625ab6867408d7aa6be57d2687ac0273f1d38 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 15 Aug 2013 18:23:15 +0000 Subject: [PATCH] add --dump-close commandline argument, if capturing and specifying a dump-length, setting this property will close the emulator after it has reached the length specified in dump-length --- BizHawk.MultiClient/MainForm.cs | 37 ++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 4c7e7287d4..5b17619043 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -138,6 +138,7 @@ namespace BizHawk.MultiClient /// number of frames to autodump /// int autoDumpLength; + bool autoCloseOnDump = false; static MainForm() { @@ -243,18 +244,20 @@ namespace BizHawk.MultiClient } string arg = args[i].ToLower(); - if (arg.StartsWith("--load-slot=")) - cmdLoadState = arg.Substring(arg.IndexOf('=') + 1); - else if (arg.StartsWith("--movie=")) - cmdMovie = arg.Substring(arg.IndexOf('=') + 1); - else if (arg.StartsWith("--dump-type=")) - cmdDumpType = arg.Substring(arg.IndexOf('=') + 1); - else if (arg.StartsWith("--dump-name=")) - cmdDumpName = arg.Substring(arg.IndexOf('=') + 1); - else if (arg.StartsWith("--dump-length=")) - int.TryParse(arg.Substring(arg.IndexOf('=') + 1), out autoDumpLength); - else - cmdRom = arg; + if (arg.StartsWith("--load-slot=")) + cmdLoadState = arg.Substring(arg.IndexOf('=') + 1); + else if (arg.StartsWith("--movie=")) + cmdMovie = arg.Substring(arg.IndexOf('=') + 1); + else if (arg.StartsWith("--dump-type=")) + cmdDumpType = arg.Substring(arg.IndexOf('=') + 1); + else if (arg.StartsWith("--dump-name=")) + cmdDumpName = arg.Substring(arg.IndexOf('=') + 1); + else if (arg.StartsWith("--dump-length=")) + int.TryParse(arg.Substring(arg.IndexOf('=') + 1), out autoDumpLength); + else if (arg.StartsWith("--dump_close=")) + autoCloseOnDump = true; + else + cmdRom = arg; } if (cmdRom != null) @@ -3762,8 +3765,14 @@ namespace BizHawk.MultiClient if (autoDumpLength > 0) { autoDumpLength--; - if (autoDumpLength == 0) // finish - StopAVI(); + if (autoDumpLength == 0) // finish + { + StopAVI(); + if (autoCloseOnDump) + { + Close(); + } + } } } }