From e0616dee76221a83d17239c2abaded66d825d993 Mon Sep 17 00:00:00 2001 From: stax76 Date: Fri, 15 Dec 2023 01:24:43 +0100 Subject: [PATCH] misc --- docs/changelog.md | 2 + docs/manual.md | 2 +- src/MpvNet.Windows/Help/WinMpvHelp.cs | 32 +++++-- src/MpvNet.Windows/Resources/editor_conf.txt | 84 ++++++++++--------- .../WPF/MsgBox/MessageBoxEx.xaml | 42 ++++++++-- .../WPF/MsgBox/MsgBoxExStatic.cs | 8 +- src/MpvNet.Windows/WinForms/MainForm.cs | 7 +- src/MpvNet/InputHelp.cs | 11 +-- 8 files changed, 125 insertions(+), 63 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 4ea0ca0..4a9bb26 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -10,6 +10,8 @@ - Improved conf file reader/writer. - Conf editor support added for the mpv options: `reset-on-next-file`, `input-ipc-server`, `background`, `title` +- When mpv.net is started for the first time from a new startup location, it asks if mpv.net should be added to the Path environment variable. + # v7.0.0.2 Beta (2023-12-13) - Besides a portable download there is now again a setup installer. diff --git a/docs/manual.md b/docs/manual.md index bc88ac5..08924af 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -393,7 +393,7 @@ For single files automatically load the entire directory into the playlist. #### --menu-syntax=\ -Used menu syntax, typically `#menu:` or `#!`. Default: `#menu:` +Used menu syntax for defining the context menu in input.conf.\nmpv.net by default uses `#menu:`, uosc uses `#!` by default. #### --process-instance=\ diff --git a/src/MpvNet.Windows/Help/WinMpvHelp.cs b/src/MpvNet.Windows/Help/WinMpvHelp.cs index 5125798..d6debeb 100644 --- a/src/MpvNet.Windows/Help/WinMpvHelp.cs +++ b/src/MpvNet.Windows/Help/WinMpvHelp.cs @@ -1,16 +1,36 @@  -using MpvNet.ExtensionMethod; +using System.Windows; + +using MpvNet.Windows.WPF; namespace MpvNet.Windows.Help; public class WinMpvHelp { - public static void CopyMpvNetCom() + public static void AddToPath() { - string dir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData).AddSep() + - "Microsoft\\WindowsApps\\"; + string path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.User)!; - if (File.Exists(dir + "mpvnet.exe") && !File.Exists(dir + "mpvnet.com")) - File.Copy(Folder.Startup + "mpvnet.com", dir + "mpvnet.com"); + if (path.ToLower().Contains(Folder.Startup.TrimEnd(Path.DirectorySeparatorChar).ToLower())) + return; + + string dir = RegistryHelp.GetString("PathEnvVarCheck"); + + if (dir == Folder.Startup) + return; + + var result = Msg.ShowQuestion("Would you like to add mpv.net to the Path environment variable?", + MessageBoxButton.YesNo); + + if (result == MessageBoxResult.Yes) + { + Environment.SetEnvironmentVariable("Path", + Folder.Startup.TrimEnd(Path.DirectorySeparatorChar) + ";" + path, + EnvironmentVariableTarget.User); + + Msg.ShowInfo("mpv.net was added successfully to Path."); + } + + RegistryHelp.SetString("PathEnvVarCheck", Folder.Startup); } } diff --git a/src/MpvNet.Windows/Resources/editor_conf.txt b/src/MpvNet.Windows/Resources/editor_conf.txt index 8bc8bf4..f280200 100644 --- a/src/MpvNet.Windows/Resources/editor_conf.txt +++ b/src/MpvNet.Windows/Resources/editor_conf.txt @@ -39,6 +39,12 @@ directory = General width = 500 help = Image file extensions used to create file associations and used by the auto-load-folder feature. (mpv.net option) +name = menu-syntax +file = mpvnet +directory = General +default = #menu: +help = Used menu syntax for defining the context menu in input.conf.\nmpv.net by default uses '#menu:', uosc uses '#!' by default. + name = debug-mode file = mpvnet default = no @@ -113,45 +119,6 @@ option = display-adrop option = display-desync option = desync -name = scale -file = mpv -default = bilinear -directory = Video -help = The GPU renderer filter function to use when upscaling video. There are some more filters, but most are not as useful. For a complete list, pass help as value, e.g.: mpv --scale=help -option = bilinear Bilinear hardware texture filtering (fastest, very low quality). -option = spline36 Mid quality and speed. This is the default when using gpu-hq. -option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc) -option = ewa_lanczos Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc) -option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default. -option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale). -option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale). - -name = cscale -file = mpv -default = bilinear -directory = Video -help = As scale, but for interpolating chroma information. If the image is not subsampled, this option is ignored entirely. -option = bilinear Bilinear hardware texture filtering (fastest, very low quality). -option = spline36 Mid quality and speed. This is the default when using gpu-hq. -option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc) -option = ewa_lanczos Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc) -option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default. -option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale). -option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale). - -name = dscale -file = mpv -default = -directory = Video -help = Like scale, but apply these filters on downscaling instead. \nIf no option is selected, it will keep the same with the upscaler. -option = bilinear Bilinear hardware texture filtering (fastest, very low quality). -option = spline36 Mid quality and speed. This is the default when using gpu-hq. -option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc) -option = ewa_lanczos Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc) -option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default. -option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale). -option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale). - name = dither-depth file = mpv default = no @@ -629,6 +596,45 @@ file = mpv directory = Video/Screenshot help = <0-5> Set the filter applied prior to PNG compression. 0 is none, 1 is 'sub', 2 is 'up', 3 is 'average', 4 is 'Paeth', and 5 is 'mixed'. This affects the level of compression that can be achieved. For most images, 'mixed' achieves the best compression ratio, hence it is the default. +name = scale +file = mpv +default = bilinear +directory = Render Options +help = The GPU renderer filter function to use when upscaling video. There are some more filters, but most are not as useful. For a complete list, pass help as value, e.g.: mpv --scale=help +option = bilinear Bilinear hardware texture filtering (fastest, very low quality). +option = spline36 Mid quality and speed. This is the default when using gpu-hq. +option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc) +option = ewa_lanczos Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc) +option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default. +option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale). +option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale). + +name = cscale +file = mpv +default = bilinear +directory = Render Options +help = As scale, but for interpolating chroma information. If the image is not subsampled, this option is ignored entirely. +option = bilinear Bilinear hardware texture filtering (fastest, very low quality). +option = spline36 Mid quality and speed. This is the default when using gpu-hq. +option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc) +option = ewa_lanczos Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc) +option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default. +option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale). +option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale). + +name = dscale +file = mpv +default = +directory = Render Options +help = Like scale, but apply these filters on downscaling instead. \nIf no option is selected, it will keep the same with the upscaler. +option = bilinear Bilinear hardware texture filtering (fastest, very low quality). +option = spline36 Mid quality and speed. This is the default when using gpu-hq. +option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc) +option = ewa_lanczos Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc) +option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default. +option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale). +option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale). + name = background file = mpv directory = Render Options diff --git a/src/MpvNet.Windows/WPF/MsgBox/MessageBoxEx.xaml b/src/MpvNet.Windows/WPF/MsgBox/MessageBoxEx.xaml index 9135bf1..1d83ffa 100644 --- a/src/MpvNet.Windows/WPF/MsgBox/MessageBoxEx.xaml +++ b/src/MpvNet.Windows/WPF/MsgBox/MessageBoxEx.xaml @@ -122,39 +122,67 @@ -