New mpv.net specific option keep-open-exit added

This commit is contained in:
stax76
2022-05-03 15:18:42 +02:00
parent cd2f2aeec8
commit 28f9df1cee
4 changed files with 27 additions and 14 deletions

View File

@@ -25,6 +25,7 @@ namespace mpvnet
public static bool AutoPlay { get; set; }
public static bool DebugMode { get; set; }
public static bool IsTerminalAttached { get; } = Environment.GetEnvironmentVariable("_started_from_console") == "yes";
public static bool KeepOpenExit { get; set; }
public static bool Queue { get; set; }
public static bool RememberVolume { get; set; } = true;
public static bool RememberWindowPosition { get; set; }
@@ -241,14 +242,15 @@ namespace mpvnet
case "dark-theme": DarkTheme = value.Trim('\'', '"'); return true;
case "debug-mode": DebugMode = value == "yes"; return true;
case "image-file-extensions": CorePlayer.ImageTypes = value.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); return true;
case "keep-open-exit": KeepOpenExit = value == "yes"; return true;
case "light-theme": LightTheme = value.Trim('\'', '"'); return true;
case "minimum-aspect-ratio": MinimumAspectRatio = value.ToFloat(); return true;
case "process-instance": ProcessInstance = value; return true;
case "queue": Queue = value == "yes"; return true;
case "recent-count": RecentCount = value.ToInt(); return true;
case "remember-volume": RememberVolume = value == "yes"; return true;
case "show-logo": ShowLogo = value == "yes"; return true;
case "remember-window-position": RememberWindowPosition = value == "yes"; return true;
case "show-logo": ShowLogo = value == "yes"; return true;
case "start-size": StartSize = value; return true;
case "start-threshold": StartThreshold = value.ToInt(); return true;
case "video-file-extensions": CorePlayer.VideoTypes = value.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); return true;

View File

@@ -139,8 +139,6 @@ namespace mpvnet
SetPropertyInt("osd-duration", 2000);
SetPropertyBool("keep-open", true);
SetPropertyBool("keep-open-pause", false);
SetPropertyBool("input-default-bindings", true);
SetPropertyBool("input-builtin-bindings", false);
@@ -162,7 +160,7 @@ namespace mpvnet
{
ShowLogo();
if (GetPropertyString("keep-open") == "no")
if (GetPropertyString("keep-open") == "no" && App.KeepOpenExit)
Core.CommandV("quit");
}
});