5.4.4.6 Beta

This commit is contained in:
Frank Skare
2020-04-25 15:36:56 +02:00
parent 82b4d19282
commit 54b2612bb8
7 changed files with 70 additions and 64 deletions

View File

@@ -1,9 +1,18 @@
5.4.4.6 Beta (not yet released) 5.4.4.7 Beta (not yet released)
============ ============
-
5.4.4.6 Beta
============
- using start-size=video the window size was not remembered
after fullscreen mode was left.
- using start-size=video the window can now use the entire
working area using autofit-larger=100
5.4.4.5 Beta 5.4.4.5 Beta
============ ============

View File

@@ -177,10 +177,6 @@ Before making a support request, please try a newer [beta version](#beta) first.
[Issue tracker](https://github.com/stax76/mpv.net/issues), feel free to use for anything mpv.net related. [Issue tracker](https://github.com/stax76/mpv.net/issues), feel free to use for anything mpv.net related.
You can support my work with a PayPal donation. The input hardware support in mpv.net is not 100% mpv compatible, people use all kind of weird input hardware and sometimes I have to buy those to support them.
<https://www.paypal.me/stax76>
Settings Settings
-------- --------

View File

@@ -1,7 +1,7 @@
![](https://raw.githubusercontent.com/stax76/mpv.net/master/img/mpvnet.png) ![](https://raw.githubusercontent.com/stax76/mpv.net/master/img/mpvnet.png)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/stax76/mpv.net) ![GitHub closed issues](https://img.shields.io/github/issues-closed/stax76/mpv.net) ![GitHub All Releases](https://img.shields.io/github/downloads/stax76/mpv.net/total) ![GitHub tag (latest by date)](https://img.shields.io/github/tag-date/stax76/mpv.net) ![GitHub stars](https://img.shields.io/github/stars/stax76/mpv.net) [![PayPal donate button](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/stax76) ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/stax76/mpv.net) ![GitHub closed issues](https://img.shields.io/github/issues-closed/stax76/mpv.net) ![GitHub All Releases](https://img.shields.io/github/downloads/stax76/mpv.net/total) ![GitHub tag (latest by date)](https://img.shields.io/github/tag-date/stax76/mpv.net) ![GitHub stars](https://img.shields.io/github/stars/stax76/mpv.net)
🎞 mpv.net 🎞 mpv.net
========== ==========

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.4.5")] [assembly: AssemblyVersion("5.4.4.6")]
[assembly: AssemblyFileVersion("5.4.4.5")] [assembly: AssemblyFileVersion("5.4.4.6")]

View File

@@ -185,6 +185,8 @@
Volume_Down add volume -10 Volume_Down add volume -10
Wheel_Up add volume 10 Wheel_Up add volume 10
Wheel_Down add volume -10 Wheel_Down add volume -10
Wheel_Left add volume -10
Wheel_Right add volume 10
Prev playlist-prev Prev playlist-prev
Next playlist-next Next playlist-next
MBTN_Forward playlist-next MBTN_Forward playlist-next
@@ -194,4 +196,5 @@
Ctrl+Wheel_Up no-osd seek 7 Ctrl+Wheel_Up no-osd seek 7
Ctrl+Wheel_Down no-osd seek -7 Ctrl+Wheel_Down no-osd seek -7
MBTN_Left_DBL cycle fullscreen MBTN_Left_DBL cycle fullscreen
KP_Enter cycle fullscreen KP_Enter cycle fullscreen

View File

@@ -280,13 +280,11 @@ namespace mpvnet
return null; return null;
} }
bool WasInitialSizeSet;
void SetFormPosAndSize(double scale = 1, bool force = false) void SetFormPosAndSize(double scale = 1, bool force = false)
{ {
if (!force) if (!force)
{ {
if (WindowState == FormWindowState.Maximized || WindowState == FormWindowState.Minimized) if (WindowState != FormWindowState.Normal)
return; return;
if (mp.Fullscreen) if (mp.Fullscreen)
@@ -304,51 +302,45 @@ namespace mpvnet
mp.VideoSize = new Size((int)(autoFitHeight * (16 / 9.0)), autoFitHeight); mp.VideoSize = new Size((int)(autoFitHeight * (16 / 9.0)), autoFitHeight);
Size size = mp.VideoSize; Size videoSize = mp.VideoSize;
int height = size.Height; int height = videoSize.Height;
if (App.StartSize == "previous" || App.StartSize == "always" || scale != 1) if (mp.WasInitialSizeSet || scale != 1)
height = ClientSize.Height;
else
{ {
if (WasInitialSizeSet || scale != 1) int savedHeight = RegistryHelp.GetInt(App.RegPath, "Height");
height = ClientSize.Height;
else
{
int savedHeight = RegistryHelp.GetInt(App.RegPath, "Height");
if (App.StartSize == "always" && savedHeight != 0) if (App.StartSize == "always" && savedHeight != 0)
height = savedHeight; height = savedHeight;
else else
if (App.StartSize != "video")
height = autoFitHeight; height = autoFitHeight;
WasInitialSizeSet = true; mp.WasInitialSizeSet = true;
}
} }
height = Convert.ToInt32(height * scale); height = Convert.ToInt32(height * scale);
int width = Convert.ToInt32(height * size.Width / (double)size.Height); int width = Convert.ToInt32(height * videoSize.Width / (double)videoSize.Height);
int maxHeight = screen.WorkingArea.Height - (Height - ClientSize.Height);
int maxWidth = screen.WorkingArea.Width - (Width - ClientSize.Width);
if (height < screen.WorkingArea.Height * mp.AutofitSmaller) if (height < maxHeight * mp.AutofitSmaller)
{ {
height = Convert.ToInt32(screen.WorkingArea.Height * mp.AutofitSmaller); height = Convert.ToInt32(maxHeight * mp.AutofitSmaller);
width = Convert.ToInt32(height * size.Width / (double)size.Height); width = Convert.ToInt32(height * videoSize.Width / (double)videoSize.Height);
} }
if (height > screen.WorkingArea.Height * mp.AutofitLarger) if (height > maxHeight * mp.AutofitLarger)
{ {
height = Convert.ToInt32(screen.WorkingArea.Height * mp.AutofitLarger); height = Convert.ToInt32(maxHeight * mp.AutofitLarger);
width = Convert.ToInt32(height * size.Width / (double)size.Height); width = Convert.ToInt32(height * videoSize.Width / (double)videoSize.Height);
} }
if (height > screen.WorkingArea.Height * 0.95) if (width > maxWidth)
{ {
height = Convert.ToInt32(screen.WorkingArea.Height * 0.95); width = maxWidth;
width = Convert.ToInt32(height * size.Width / (double)size.Height); height = Convert.ToInt32(width * videoSize.Height / (double)videoSize.Width);
}
if (width > screen.WorkingArea.Width * 0.95)
{
width = Convert.ToInt32(screen.WorkingArea.Width * 0.95);
height = Convert.ToInt32(width * size.Height / (double)size.Width);
} }
Point middlePos = new Point(Left + Width / 2, Top + Height / 2); Point middlePos = new Point(Left + Width / 2, Top + Height / 2);
@@ -375,7 +367,8 @@ namespace mpvnet
if (top + rect.Height > maxBottom) if (top + rect.Height > maxBottom)
top = maxBottom - rect.Height; top = maxBottom - rect.Height;
WinAPI.SetWindowPos(Handle, IntPtr.Zero /* HWND_TOP */, left, top, rect.Width, rect.Height, 4 /* SWP_NOZORDER */); WinAPI.SetWindowPos(Handle, IntPtr.Zero /* HWND_TOP */,
left, top, rect.Width, rect.Height, 4 /* SWP_NOZORDER */);
} }
public void CycleFullscreen(bool enabled) public void CycleFullscreen(bool enabled)
@@ -508,20 +501,20 @@ namespace mpvnet
switch (m.Msg) switch (m.Msg)
{ {
case 0x0201: // WM_LBUTTONDOWN case 0x201: // WM_LBUTTONDOWN
case 0x0202: // WM_LBUTTONUP case 0x202: // WM_LBUTTONUP
case 0x0207: // WM_MBUTTONDOWN case 0x207: // WM_MBUTTONDOWN
case 0x0208: // WM_MBUTTONUP case 0x208: // WM_MBUTTONUP
case 0x020b: // WM_XBUTTONDOWN case 0x20b: // WM_XBUTTONDOWN
case 0x020c: // WM_XBUTTONUP case 0x20c: // WM_XBUTTONUP
case 0x020A: // WM_MOUSEWHEEL case 0x20A: // WM_MOUSEWHEEL
case 0x0100: // WM_KEYDOWN case 0x100: // WM_KEYDOWN
case 0x0101: // WM_KEYUP case 0x101: // WM_KEYUP
case 0x0102: // WM_CHAR case 0x102: // WM_CHAR
case 0x0104: // WM_SYSKEYDOWN case 0x104: // WM_SYSKEYDOWN
case 0x0105: // WM_SYSKEYUP case 0x105: // WM_SYSKEYUP
case 0x0106: // WM_SYSCHAR case 0x106: // WM_SYSCHAR
case 0x319: // WM_APPCOMMAND case 0x319: // WM_APPCOMMAND
if (mp.WindowHandle != IntPtr.Zero) if (mp.WindowHandle != IntPtr.Zero)
m.Result = WinAPI.SendMessage(mp.WindowHandle, m.Msg, m.WParam, m.LParam); m.Result = WinAPI.SendMessage(mp.WindowHandle, m.Msg, m.WParam, m.LParam);
break; break;
@@ -730,9 +723,9 @@ namespace mpvnet
ToolStripRendererEx.ForegroundColor = Theme.Current.GetWinFormsColor("menu-foreground"); ToolStripRendererEx.ForegroundColor = Theme.Current.GetWinFormsColor("menu-foreground");
ToolStripRendererEx.BackgroundColor = Theme.Current.GetWinFormsColor("menu-background"); ToolStripRendererEx.BackgroundColor = Theme.Current.GetWinFormsColor("menu-background");
ToolStripRendererEx.SelectionColor = Theme.Current.GetWinFormsColor("menu-highlight"); ToolStripRendererEx.SelectionColor = Theme.Current.GetWinFormsColor("menu-highlight");
ToolStripRendererEx.BorderColor = Theme.Current.GetWinFormsColor("menu-border"); ToolStripRendererEx.BorderColor = Theme.Current.GetWinFormsColor("menu-border");
ToolStripRendererEx.CheckedColor = Theme.Current.GetWinFormsColor("menu-checked"); ToolStripRendererEx.CheckedColor = Theme.Current.GetWinFormsColor("menu-checked");
BuildMenu(); BuildMenu();
ContextMenuStrip = ContextMenu; ContextMenuStrip = ContextMenu;
@@ -788,10 +781,7 @@ namespace mpvnet
protected override void OnFormClosing(FormClosingEventArgs e) protected override void OnFormClosing(FormClosingEventArgs e)
{ {
base.OnFormClosing(e); base.OnFormClosing(e);
SaveWindowProperties();
if (WindowState == FormWindowState.Normal)
SaveWindowProperties();
RegistryHelp.SetValue(App.RegPath, "Recent", RecentFiles.ToArray()); RegistryHelp.SetValue(App.RegPath, "Recent", RecentFiles.ToArray());
if (mp.IsQuitNeeded) if (mp.IsQuitNeeded)

View File

@@ -72,7 +72,7 @@ namespace mpvnet
public static List<PythonScript> PythonScripts { get; set; } = new List<PythonScript>(); public static List<PythonScript> PythonScripts { get; set; } = new List<PythonScript>();
public static Size VideoSize { get; set; } public static Size VideoSize { get; set; }
public static TimeSpan Duration; public static TimeSpan Duration;
public static AutoResetEvent ShutdownAutoResetEvent { get; } = new AutoResetEvent(false); public static AutoResetEvent ShutdownAutoResetEvent { get; } = new AutoResetEvent(false);
public static AutoResetEvent VideoSizeAutoResetEvent { get; } = new AutoResetEvent(false); public static AutoResetEvent VideoSizeAutoResetEvent { get; } = new AutoResetEvent(false);
public static string InputConfPath { get => ConfigFolder + "input.conf"; } public static string InputConfPath { get => ConfigFolder + "input.conf"; }
@@ -82,6 +82,7 @@ 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 WasInitialSizeSet;
public static bool Border { get; set; } = true; public static bool Border { get; set; } = true;
public static bool Fullscreen { get; set; } public static bool Fullscreen { get; set; }
public static bool IsLogoVisible { set; get; } public static bool IsLogoVisible { set; get; }
@@ -160,6 +161,9 @@ namespace mpvnet
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;
} }
if (AutofitLarger > 1)
AutofitLarger = 1;
} }
static string _ConfigFolder; static string _ConfigFolder;
@@ -367,6 +371,10 @@ namespace mpvnet
{ {
HideLogo(); HideLogo();
Duration = TimeSpan.FromSeconds(get_property_number("duration")); Duration = TimeSpan.FromSeconds(get_property_number("duration"));
if (App.StartSize == "video")
mp.WasInitialSizeSet = false;
Size size = new Size(get_property_int("width"), get_property_int("height")); Size size = new Size(get_property_int("width"), get_property_int("height"));
if (size.Width == 0 || size.Height == 0) if (size.Width == 0 || size.Height == 0)