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");
}
});

View File

@@ -505,6 +505,17 @@ help = Show progress in taskbar.
option = yes
option = no
[setting]
name = keep-open
file = mpv
default = no
filter = Playback
help = Using no, mpv would terminate after the last file but mpv.net never terminates automatically.
option = yes If the current file ends, go to the next file, keep the last file open.
option = no If the current file ends, go to the next file.
option = always Playback will never automatically advance to the next file.
[setting]
name = keep-open-pause
file = mpv
@@ -516,15 +527,14 @@ option = yes
option = no
[setting]
name = keep-open
file = mpv
default = yes
name = keep-open-exit
file = mpvnet
default = no
filter = Playback
help = Using no, mpv would terminate after the last file but mpv.net never terminates automatically.
help = If set to yes and keep-open is set to no, mpv.net exits after the last file ends.
option = yes If the current file ends, go to the next file, keep the last file open.
option = no If the current file ends, go to the next file.
option = always Playback will never automatically advance to the next file.
option = yes
option = no
[setting]
name = auto-play