mpv setting osd-scale-by-window added to config dialog
This commit is contained in:
11
Changelog.md
11
Changelog.md
@@ -1,3 +1,14 @@
|
|||||||
|
### 5.2.1.3
|
||||||
|
|
||||||
|
- in the config dialog the description for keep-open was corrected
|
||||||
|
because unlike mpv, mpv.net will never terminate automatically
|
||||||
|
- there was a rare occasion where the mpv.net logo wasn't shown
|
||||||
|
- mpv setting osd-scale-by-window added to config dialog
|
||||||
|
|
||||||
|
### 5.2.1.2
|
||||||
|
|
||||||
|
- fix excessive memory usage using `osd-scale-by-window = no`
|
||||||
|
|
||||||
### 5.2.1
|
### 5.2.1
|
||||||
|
|
||||||
- fixed race condition causing various features to fail
|
- fixed race condition causing various features to fail
|
||||||
|
|||||||
@@ -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.2.1.0")]
|
[assembly: AssemblyVersion("5.2.1.3")]
|
||||||
[assembly: AssemblyFileVersion("5.2.1.0")]
|
[assembly: AssemblyFileVersion("5.2.1.3")]
|
||||||
|
|||||||
@@ -1,17 +1,11 @@
|
|||||||
|
|
||||||
# This file defines the input (keys and mouse) bindings of mpv and mpv.net
|
# This file defines the key and mouse bindings and the context menu
|
||||||
# and it also defines the context menu of mpv.net. mpv.net has an input
|
# of mpv.net. A input and config editor can be found in mpv.net's
|
||||||
# editor and an config editor as alternative to editing conf text files.
|
# context menu under 'Settings'. The defaults of this file can be found at:
|
||||||
# The input and config editor can be found in mpv.net's context menu at:
|
|
||||||
|
|
||||||
# Settings > Show Config Editor
|
|
||||||
# Settings > Show Input Editor
|
|
||||||
|
|
||||||
# The defaults of this file can be found at:
|
|
||||||
|
|
||||||
# https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt
|
# https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt
|
||||||
|
|
||||||
# the defaults of mpv can be found at:
|
# The defaults of mpv can be found at:
|
||||||
|
|
||||||
# https://github.com/mpv-player/mpv/blob/master/etc/input.conf
|
# https://github.com/mpv-player/mpv/blob/master/etc/input.conf
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ filter = "Video"
|
|||||||
help = "Controls which type of graphics APIs will be accepted. Auto uses d3d11, it should only be changed in case of problems."
|
help = "Controls which type of graphics APIs will be accepted. Auto uses d3d11, it should only be changed in case of problems."
|
||||||
options = [{ name = "auto", help = "Use any available API" },
|
options = [{ name = "auto", help = "Use any available API" },
|
||||||
{ name = "opengl", help = "Allow only OpenGL (requires OpenGL 2.1+ or GLES 2.0+)" },
|
{ name = "opengl", help = "Allow only OpenGL (requires OpenGL 2.1+ or GLES 2.0+)" },
|
||||||
{ name = "vulkan", help = "Allow only Vulkan (requires a valid/working spirv-compiler)" },
|
{ name = "vulkan", help = "Allow only Vulkan (requires a working spirv-compiler). " },
|
||||||
{ name = "d3d11", help = "Allow only gpu-context=d3d11" }]
|
{ name = "d3d11", help = "Allow only gpu-context=d3d11" }]
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
@@ -241,6 +241,14 @@ default = "55"
|
|||||||
filter = "Screen"
|
filter = "Screen"
|
||||||
help = "Specify the OSD font size. See sub-font-size for details. Default: 55"
|
help = "Specify the OSD font size. See sub-font-size for details. Default: 55"
|
||||||
|
|
||||||
|
[[settings]]
|
||||||
|
name = "osd-scale-by-window"
|
||||||
|
default = "yes"
|
||||||
|
filter = "Screen"
|
||||||
|
help = "Whether to scale the OSD with the window size. If this is disabled, osd-font-size and other OSD options that use scaled pixels are always in actual pixels. The effect is that changing the window size won't change the OSD font size."
|
||||||
|
options = [{ name = "yes" },
|
||||||
|
{ name = "no" }]
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
name = "autofit"
|
name = "autofit"
|
||||||
filter = "Screen"
|
filter = "Screen"
|
||||||
@@ -283,7 +291,7 @@ options = [{ name = "yes" },
|
|||||||
name = "screenshot-high-bit-depth"
|
name = "screenshot-high-bit-depth"
|
||||||
default = "yes"
|
default = "yes"
|
||||||
filter = "Screen"
|
filter = "Screen"
|
||||||
help = "If possible, write screenshots with a bit depth similar to the source video (default: yes). This is interesting in particular for PNG, as this sometimes triggers writing 16 bit PNGs with huge file sizes. This will also include an unused alpha channel in the resulting files if 16 bit is used."
|
help = "If possible, write screenshots with a bit depth similar to the source video. This is interesting in particular for PNG, as this sometimes triggers writing 16 bit PNGs with huge file sizes. This will also include an unused alpha channel in the resulting files if 16 bit is used."
|
||||||
options = [{ name = "yes" },
|
options = [{ name = "yes" },
|
||||||
{ name = "no" }]
|
{ name = "no" }]
|
||||||
|
|
||||||
@@ -291,7 +299,7 @@ options = [{ name = "yes" },
|
|||||||
name = "screenshot-jpeg-source-chroma"
|
name = "screenshot-jpeg-source-chroma"
|
||||||
default = "yes"
|
default = "yes"
|
||||||
filter = "Screen"
|
filter = "Screen"
|
||||||
help = "Write JPEG files with the same chroma subsampling as the video (default: yes). If disabled, the libjpeg default is used."
|
help = "Write JPEG files with the same chroma subsampling as the video. If disabled, the libjpeg default is used."
|
||||||
options = [{ name = "yes" },
|
options = [{ name = "yes" },
|
||||||
{ name = "no" }]
|
{ name = "no" }]
|
||||||
|
|
||||||
@@ -329,10 +337,10 @@ options = [{ name = "yes" },
|
|||||||
name = "keep-open"
|
name = "keep-open"
|
||||||
default = "no"
|
default = "no"
|
||||||
filter = "Playback"
|
filter = "Playback"
|
||||||
help = "Do not terminate when playing or seeking beyond the end of the file, and there is not next file to be played (and loop is not used). Instead, pause the player. When trying to seek beyond end of the file, the player will attempt to seek to the last frame.\n\nNormally, this will act like set pause yes on EOF, unless the keep-open-pause=no option is set."
|
help = "Unlike mpv, mpv.net never exits automatically."
|
||||||
options = [{ name = "yes", help = "Don't terminate if the current file is the last playlist entry. Equivalent to keep-open without arguments."},
|
options = [{ name = "yes", help = "Useless in mpv.net because mpv.net never terminates automatically."},
|
||||||
{ name = "no", help = "If the current file ends, go to the next file or terminate." },
|
{ name = "no", help = "If the current file ends, go to the next file." },
|
||||||
{ name = "always", help = "Like yes, but also applies to files before the last playlist entry. This means playback will never automatically advance to the next file."}]
|
{ name = "always", help = "Playback will never automatically advance to the next file."}]
|
||||||
|
|
||||||
[[settings]]
|
[[settings]]
|
||||||
name = "loop-file"
|
name = "loop-file"
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
SearchControl.SearchTextBox.SelectAll();
|
SearchControl.SearchTextBox.SelectAll();
|
||||||
Keyboard.Focus(SearchControl.SearchTextBox);
|
Keyboard.Focus(SearchControl.SearchTextBox);
|
||||||
|
|
||||||
foreach (var i in MainStackPanel.Children.OfType<StringSettingControl>())
|
foreach (var i in MainStackPanel.Children.OfType<StringSettingControl>())
|
||||||
i.Update();
|
i.Update();
|
||||||
}
|
}
|
||||||
|
|||||||
2
mpv.net/WinForms/MainForm.Designer.cs
generated
2
mpv.net/WinForms/MainForm.Designer.cs
generated
@@ -45,7 +45,7 @@
|
|||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(288F, 288F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(288F, 288F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||||
this.BackColor = System.Drawing.Color.Black;
|
this.BackColor = System.Drawing.Color.Black;
|
||||||
this.ClientSize = new System.Drawing.Size(542, 0);
|
this.ClientSize = new System.Drawing.Size(668, 345);
|
||||||
this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
|
|||||||
@@ -33,6 +33,22 @@ namespace mpvnet
|
|||||||
Instance = this;
|
Instance = this;
|
||||||
Hwnd = Handle;
|
Hwnd = Handle;
|
||||||
mp.Init();
|
mp.Init();
|
||||||
|
|
||||||
|
mp.Shutdown += Shutdown;
|
||||||
|
mp.VideoSizeChanged += VideoSizeChanged;
|
||||||
|
mp.FileLoaded += FileLoaded;
|
||||||
|
mp.Idle += Idle;
|
||||||
|
|
||||||
|
mp.observe_property_bool("fullscreen", PropChangeFullscreen);
|
||||||
|
mp.observe_property_bool("ontop", PropChangeOnTop);
|
||||||
|
mp.observe_property_bool("border", PropChangeBorder);
|
||||||
|
mp.observe_property_string("sid", PropChangeSid);
|
||||||
|
mp.observe_property_string("aid", PropChangeAid);
|
||||||
|
mp.observe_property_string("vid", PropChangeVid);
|
||||||
|
mp.observe_property_int("edition", PropChangeEdition);
|
||||||
|
|
||||||
|
if (mp.GPUAPI != "vulkan") mp.ProcessCommandLine(false);
|
||||||
|
|
||||||
AppDomain.CurrentDomain.UnhandledException += (sender, e) => Msg.ShowError(e.ExceptionObject.ToString());
|
AppDomain.CurrentDomain.UnhandledException += (sender, e) => Msg.ShowError(e.ExceptionObject.ToString());
|
||||||
Application.ThreadException += (sender, e) => Msg.ShowException(e.Exception);
|
Application.ThreadException += (sender, e) => Msg.ShowException(e.Exception);
|
||||||
Msg.SupportURL = "https://github.com/stax76/mpv.net#support";
|
Msg.SupportURL = "https://github.com/stax76/mpv.net#support";
|
||||||
@@ -67,22 +83,6 @@ namespace mpvnet
|
|||||||
Left = posX - Width / 2;
|
Left = posX - Width / 2;
|
||||||
Top = posY - Height / 2;
|
Top = posY - Height / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
mp.Shutdown += Shutdown;
|
|
||||||
mp.VideoSizeChanged += VideoSizeChanged;
|
|
||||||
mp.FileLoaded += FileLoaded;
|
|
||||||
mp.Idle += Idle;
|
|
||||||
|
|
||||||
mp.observe_property_bool("fullscreen", PropChangeFullscreen);
|
|
||||||
mp.observe_property_bool("ontop", PropChangeOnTop);
|
|
||||||
mp.observe_property_bool("border", PropChangeBorder);
|
|
||||||
mp.observe_property_string("sid", PropChangeSid);
|
|
||||||
mp.observe_property_string("aid", PropChangeAid);
|
|
||||||
mp.observe_property_string("vid", PropChangeVid);
|
|
||||||
mp.observe_property_int("edition", PropChangeEdition);
|
|
||||||
|
|
||||||
if (mp.GPUAPI != "vulkan") mp.VideoSizeAutoResetEvent.WaitOne(App.StartThreshold);
|
|
||||||
if (Height < FontHeight * 4) SetFormPosAndSize();
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -510,7 +510,8 @@ namespace mpvnet
|
|||||||
protected override void OnLoad(EventArgs e)
|
protected override void OnLoad(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnLoad(e);
|
base.OnLoad(e);
|
||||||
if (mp.get_property_int("playlist-count") == 0) mp.ShowLogo();
|
if (mp.GPUAPI != "vulkan") mp.VideoSizeAutoResetEvent.WaitOne(App.StartThreshold);
|
||||||
|
SetFormPosAndSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnShown(EventArgs e)
|
protected override void OnShown(EventArgs e)
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ namespace mpvnet
|
|||||||
mpv_initialize(Handle);
|
mpv_initialize(Handle);
|
||||||
Initialized?.Invoke();
|
Initialized?.Invoke();
|
||||||
LoadMpvScripts();
|
LoadMpvScripts();
|
||||||
if (GPUAPI != "vulkan") ProcessCommandLine(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ProcessProperty(string name, string value)
|
public static void ProcessProperty(string name, string value)
|
||||||
@@ -339,7 +338,7 @@ namespace mpvnet
|
|||||||
break;
|
break;
|
||||||
case mpv_event_id.MPV_EVENT_IDLE:
|
case mpv_event_id.MPV_EVENT_IDLE:
|
||||||
Idle?.Invoke();
|
Idle?.Invoke();
|
||||||
if (get_property_int("playlist-count") == 0) ShowLogo();
|
ShowLogo();
|
||||||
break;
|
break;
|
||||||
case mpv_event_id.MPV_EVENT_PAUSE:
|
case mpv_event_id.MPV_EVENT_PAUSE:
|
||||||
Pause?.Invoke();
|
Pause?.Invoke();
|
||||||
@@ -377,19 +376,22 @@ namespace mpvnet
|
|||||||
var propData = (mpv_event_property)Marshal.PtrToStructure(evt.data, typeof(mpv_event_property));
|
var propData = (mpv_event_property)Marshal.PtrToStructure(evt.data, typeof(mpv_event_property));
|
||||||
|
|
||||||
if (propData.format == mpv_format.MPV_FORMAT_FLAG)
|
if (propData.format == mpv_format.MPV_FORMAT_FLAG)
|
||||||
foreach (var i in BoolPropChangeActions)
|
lock (BoolPropChangeActions)
|
||||||
if (i.Key== propData.name)
|
foreach (var i in BoolPropChangeActions)
|
||||||
i.Value.Invoke(Marshal.PtrToStructure<int>(propData.data) == 1);
|
if (i.Key== propData.name)
|
||||||
|
i.Value.Invoke(Marshal.PtrToStructure<int>(propData.data) == 1);
|
||||||
|
|
||||||
if (propData.format == mpv_format.MPV_FORMAT_STRING)
|
if (propData.format == mpv_format.MPV_FORMAT_STRING)
|
||||||
foreach (var i in StringPropChangeActions)
|
lock (StringPropChangeActions)
|
||||||
if (i.Key == propData.name)
|
foreach (var i in StringPropChangeActions)
|
||||||
i.Value.Invoke(StringFromNativeUtf8(Marshal.PtrToStructure<IntPtr>(propData.data)));
|
if (i.Key == propData.name)
|
||||||
|
i.Value.Invoke(StringFromNativeUtf8(Marshal.PtrToStructure<IntPtr>(propData.data)));
|
||||||
|
|
||||||
if (propData.format == mpv_format.MPV_FORMAT_INT64)
|
if (propData.format == mpv_format.MPV_FORMAT_INT64)
|
||||||
foreach (var i in IntPropChangeActions)
|
lock (IntPropChangeActions)
|
||||||
if (i.Key == propData.name)
|
foreach (var i in IntPropChangeActions)
|
||||||
i.Value.Invoke(Marshal.PtrToStructure<int>(propData.data));
|
if (i.Key == propData.name)
|
||||||
|
i.Value.Invoke(Marshal.PtrToStructure<int>(propData.data));
|
||||||
break;
|
break;
|
||||||
case mpv_event_id.MPV_EVENT_PLAYBACK_RESTART:
|
case mpv_event_id.MPV_EVENT_PLAYBACK_RESTART:
|
||||||
PlaybackRestart?.Invoke();
|
PlaybackRestart?.Invoke();
|
||||||
@@ -548,7 +550,8 @@ namespace mpvnet
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
throw new Exception($"{name}: {(mpv_error)err}");
|
throw new Exception($"{name}: {(mpv_error)err}");
|
||||||
else
|
else
|
||||||
IntPropChangeActions.Add(new KeyValuePair<string, Action<int>>(name, action));
|
lock (IntPropChangeActions)
|
||||||
|
IntPropChangeActions.Add(new KeyValuePair<string, Action<int>>(name, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void observe_property_bool(string name, Action<bool> action)
|
public static void observe_property_bool(string name, Action<bool> action)
|
||||||
@@ -558,7 +561,8 @@ namespace mpvnet
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
throw new Exception($"{name}: {(mpv_error)err}");
|
throw new Exception($"{name}: {(mpv_error)err}");
|
||||||
else
|
else
|
||||||
BoolPropChangeActions.Add(new KeyValuePair<string, Action<bool>>(name, action));
|
lock (BoolPropChangeActions)
|
||||||
|
BoolPropChangeActions.Add(new KeyValuePair<string, Action<bool>>(name, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void observe_property_string(string name, Action<string> action)
|
public static void observe_property_string(string name, Action<string> action)
|
||||||
@@ -568,7 +572,8 @@ namespace mpvnet
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
throw new Exception($"{name}: {(mpv_error)err}");
|
throw new Exception($"{name}: {(mpv_error)err}");
|
||||||
else
|
else
|
||||||
StringPropChangeActions.Add(new KeyValuePair<string, Action<string>>(name, action));
|
lock (StringPropChangeActions)
|
||||||
|
StringPropChangeActions.Add(new KeyValuePair<string, Action<string>>(name, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ProcessCommandLine(bool preInit)
|
public static void ProcessCommandLine(bool preInit)
|
||||||
@@ -631,8 +636,8 @@ namespace mpvnet
|
|||||||
|
|
||||||
if (files.Count == 0 || files[0].Contains("://"))
|
if (files.Count == 0 || files[0].Contains("://"))
|
||||||
{
|
{
|
||||||
VideoSizeAutoResetEvent.Set();
|
|
||||||
VideoSizeChanged?.Invoke();
|
VideoSizeChanged?.Invoke();
|
||||||
|
VideoSizeAutoResetEvent.Set();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user