window-maximized support added
This commit is contained in:
11
Changelog.md
11
Changelog.md
@@ -1,7 +1,14 @@
|
|||||||
|
|
||||||
### 5.4.4.3
|
5.4.4.3
|
||||||
|
=======
|
||||||
|
|
||||||
|
new
|
||||||
|
---
|
||||||
|
- update MediaInfo 20.03
|
||||||
|
- mpv property window-maximized support added, cycling it from input.conf
|
||||||
|
might not be 100% reliable, it's likely a bug in the mpv client API and
|
||||||
|
will be further investigated soon
|
||||||
|
|
||||||
- update: MediaInfo 20.03
|
|
||||||
|
|
||||||
### 5.4.4.2
|
### 5.4.4.2
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ namespace mpvnet
|
|||||||
|
|
||||||
public static bool RememberHeight { get; set; } = true;
|
public static bool RememberHeight { get; set; } = true;
|
||||||
public static bool RememberPosition { get; set; }
|
public static bool RememberPosition { get; set; }
|
||||||
public static bool Maximized { get; set; }
|
|
||||||
public static bool DebugMode { get; set; }
|
public static bool DebugMode { get; set; }
|
||||||
public static bool IsStartedFromTerminal { get; } = Environment.GetEnvironmentVariable("_started_from_console") == "yes";
|
public static bool IsStartedFromTerminal { get; } = Environment.GetEnvironmentVariable("_started_from_console") == "yes";
|
||||||
public static bool RememberVolume { get; set; } = true;
|
public static bool RememberVolume { get; set; } = true;
|
||||||
@@ -171,7 +170,6 @@ namespace mpvnet
|
|||||||
switch (name)
|
switch (name)
|
||||||
{
|
{
|
||||||
case "remember-position": RememberPosition = value == "yes"; return true;
|
case "remember-position": RememberPosition = value == "yes"; return true;
|
||||||
case "maximized": Maximized = value == "yes"; return true;
|
|
||||||
case "debug-mode": DebugMode = value == "yes"; return true;
|
case "debug-mode": DebugMode = value == "yes"; return true;
|
||||||
case "remember-volume": RememberVolume = value == "yes"; return true;
|
case "remember-volume": RememberVolume = value == "yes"; return true;
|
||||||
case "queue": Queue = value == "yes"; return true;
|
case "queue": Queue = value == "yes"; return true;
|
||||||
|
|||||||
@@ -359,11 +359,11 @@ options = [{ name = "yes" },
|
|||||||
{ name = "no" }]
|
{ name = "no" }]
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
name = "maximized"
|
name = "window-maximized"
|
||||||
file = "mpvnet"
|
file = "mpv"
|
||||||
default = "no"
|
default = "no"
|
||||||
filter = "Screen"
|
filter = "Screen"
|
||||||
help = "Start with a maximized window. (mpv.net specific setting)"
|
help = "Start with a maximized window."
|
||||||
options = [{ name = "yes" },
|
options = [{ name = "yes" },
|
||||||
{ name = "no" }]
|
{ name = "no" }]
|
||||||
|
|
||||||
|
|||||||
@@ -53,13 +53,16 @@ namespace mpvnet
|
|||||||
mp.Idle += Idle;
|
mp.Idle += Idle;
|
||||||
mp.Seek += () => UpdateProgressBar();
|
mp.Seek += () => UpdateProgressBar();
|
||||||
|
|
||||||
|
mp.observe_property_bool("window-maximized", PropChangeWindowMaximized);
|
||||||
mp.observe_property_bool("pause", PropChangePause);
|
mp.observe_property_bool("pause", PropChangePause);
|
||||||
mp.observe_property_bool("fullscreen", PropChangeFullscreen);
|
mp.observe_property_bool("fullscreen", PropChangeFullscreen);
|
||||||
mp.observe_property_bool("ontop", PropChangeOnTop);
|
mp.observe_property_bool("ontop", PropChangeOnTop);
|
||||||
mp.observe_property_bool("border", PropChangeBorder);
|
mp.observe_property_bool("border", PropChangeBorder);
|
||||||
|
|
||||||
mp.observe_property_string("sid", PropChangeSid);
|
mp.observe_property_string("sid", PropChangeSid);
|
||||||
mp.observe_property_string("aid", PropChangeAid);
|
mp.observe_property_string("aid", PropChangeAid);
|
||||||
mp.observe_property_string("vid", PropChangeVid);
|
mp.observe_property_string("vid", PropChangeVid);
|
||||||
|
|
||||||
mp.observe_property_int("edition", PropChangeEdition);
|
mp.observe_property_int("edition", PropChangeEdition);
|
||||||
mp.observe_property_double("window-scale", PropChangeWindowScale);
|
mp.observe_property_double("window-scale", PropChangeWindowScale);
|
||||||
|
|
||||||
@@ -102,7 +105,7 @@ namespace mpvnet
|
|||||||
Top = posY - Height / 2;
|
Top = posY - Height / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (App.Maximized)
|
if (mp.WindowMaximized)
|
||||||
{
|
{
|
||||||
SetFormPosAndSize(1, true);
|
SetFormPosAndSize(1, true);
|
||||||
WindowState = FormWindowState.Maximized;
|
WindowState = FormWindowState.Maximized;
|
||||||
@@ -601,6 +604,22 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PropChangeWindowMaximized(bool enabled)
|
||||||
|
{
|
||||||
|
//TODO: this might not be reliable
|
||||||
|
if (!WasShown)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mp.WindowMaximized = enabled;
|
||||||
|
|
||||||
|
Invoke(new Action(() => {
|
||||||
|
if (mp.WindowMaximized && WindowState != FormWindowState.Maximized)
|
||||||
|
WindowState = FormWindowState.Maximized;
|
||||||
|
else if (!mp.WindowMaximized && WindowState == FormWindowState.Maximized)
|
||||||
|
WindowState = FormWindowState.Normal;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
void PropChangeBorder(bool enabled) {
|
void PropChangeBorder(bool enabled) {
|
||||||
mp.Border = enabled;
|
mp.Border = enabled;
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ namespace mpvnet
|
|||||||
public static List<KeyValuePair<string, Action<int>>> IntPropChangeActions { get; set; } = new List<KeyValuePair<string, Action<int>>>();
|
public static List<KeyValuePair<string, Action<int>>> IntPropChangeActions { get; set; } = new List<KeyValuePair<string, Action<int>>>();
|
||||||
public static List<KeyValuePair<string, Action<double>>> DoublePropChangeActions { get; set; } = new List<KeyValuePair<string, Action<double>>>();
|
public static List<KeyValuePair<string, Action<double>>> DoublePropChangeActions { get; set; } = new List<KeyValuePair<string, Action<double>>>();
|
||||||
public static List<KeyValuePair<string, Action<string>>> StringPropChangeActions { get; set; } = new List<KeyValuePair<string, Action<string>>>();
|
public static List<KeyValuePair<string, Action<string>>> StringPropChangeActions { get; set; } = new List<KeyValuePair<string, Action<string>>>();
|
||||||
|
|
||||||
public static List<MediaTrack> MediaTracks { get; set; } = new List<MediaTrack>();
|
public static List<MediaTrack> MediaTracks { get; set; } = new List<MediaTrack>();
|
||||||
public static List<KeyValuePair<string, double>> Chapters { get; set; } = new List<KeyValuePair<string, double>>();
|
public static List<KeyValuePair<string, double>> Chapters { get; set; } = new List<KeyValuePair<string, double>>();
|
||||||
public static IntPtr Handle { get; set; }
|
public static IntPtr Handle { get; set; }
|
||||||
@@ -80,11 +81,12 @@ namespace mpvnet
|
|||||||
public static string Vid { get; set; } = "";
|
public static string Vid { get; set; } = "";
|
||||||
public static string GPUAPI { get; set; } = "auto";
|
public static string GPUAPI { get; set; } = "auto";
|
||||||
|
|
||||||
|
public static bool Border { get; set; } = true;
|
||||||
|
public static bool Fullscreen { get; set; }
|
||||||
public static bool IsLogoVisible { set; get; }
|
public static bool IsLogoVisible { set; get; }
|
||||||
public static bool IsQuitNeeded { set; get; } = true;
|
public static bool IsQuitNeeded { set; get; } = true;
|
||||||
public static bool Fullscreen { get; set; }
|
|
||||||
public static bool Border { get; set; } = true;
|
|
||||||
public static bool TaskbarProgress { get; set; } = true;
|
public static bool TaskbarProgress { get; set; } = true;
|
||||||
|
public static bool WindowMaximized { get; set; }
|
||||||
|
|
||||||
public static int Screen { get; set; } = -1;
|
public static int Screen { get; set; } = -1;
|
||||||
public static int Edition { get; set; }
|
public static int Edition { get; set; }
|
||||||
@@ -150,6 +152,7 @@ namespace mpvnet
|
|||||||
case "fs":
|
case "fs":
|
||||||
case "fullscreen": Fullscreen = value == "yes"; break;
|
case "fullscreen": Fullscreen = value == "yes"; break;
|
||||||
case "border": Border = value == "yes"; break;
|
case "border": Border = value == "yes"; break;
|
||||||
|
case "window-maximized": WindowMaximized = value == "yes"; break;
|
||||||
case "taskbar-progress": TaskbarProgress = value == "yes"; break;
|
case "taskbar-progress": TaskbarProgress = value == "yes"; break;
|
||||||
case "screen": Screen = Convert.ToInt32(value); break;
|
case "screen": Screen = Convert.ToInt32(value); break;
|
||||||
case "gpu-api": GPUAPI = value; break;
|
case "gpu-api": GPUAPI = value; break;
|
||||||
@@ -251,6 +254,7 @@ namespace mpvnet
|
|||||||
foreach (var i in _Conf)
|
foreach (var i in _Conf)
|
||||||
ProcessProperty(i.Key, i.Value);
|
ProcessProperty(i.Key, i.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _Conf;
|
return _Conf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user