diff --git a/docs/changelog.md b/docs/changelog.md
index 0756711..1edf929 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -1,4 +1,11 @@
+# v7.0.0.4 Beta (2023-??-??)
+
+- The conf editor uses a newly developed combo box control instead of radio buttons
+ whenever an option has more than 3 items.
+- New zhongfly libmpv build.
+
+
# v7.0.0.3 Beta (2023-12-15)
- New conf editor option `Video/libplacebo/preset`.
diff --git a/src/MpvNet.Windows/Conf.cs b/src/MpvNet.Windows/Conf.cs
index 27ccd73..c752aa6 100644
--- a/src/MpvNet.Windows/Conf.cs
+++ b/src/MpvNet.Windows/Conf.cs
@@ -53,6 +53,7 @@ public class Conf
if (section.HasName("help")) baseSetting.Help = section.GetValue("help");
if (section.HasName("url")) baseSetting.URL = section.GetValue("url");
if (section.HasName("width")) baseSetting.Width = Convert.ToInt32(section.GetValue("width"));
+ if (section.HasName("option-name-width")) baseSetting.OptionNameWidth = Convert.ToInt32(section.GetValue("option-name-width"));
if (section.HasName("type")) baseSetting.Type = section.GetValue("type");
if (baseSetting.Help.ContainsEx("\\n"))
diff --git a/src/MpvNet.Windows/Resources/editor_conf.txt b/src/MpvNet.Windows/Resources/editor_conf.txt
index 12db7ce..9ed9107 100644
--- a/src/MpvNet.Windows/Resources/editor_conf.txt
+++ b/src/MpvNet.Windows/Resources/editor_conf.txt
@@ -3,7 +3,7 @@ name = process-instance
file = mpvnet
default = single
directory = General
-help = Defines if more then one mpv.net process is allowed. (mpv.net option)\n\nMulti can alternatively be enabled by pressing the SHIFT key.
+help = Defines if more then one mpv.net process is allowed.\nMulti can alternatively be enabled by pressing the SHIFT key. (mpv.net option)
option = multi Create a new process everytime the shell starts mpv.net
option = single Force a single process everytime the shell starts mpv.net
option = queue Force a single process and add files to playlist
@@ -73,14 +73,14 @@ option = auto enable best hw decoder
option = yes exactly the same as auto
option = auto-copy enable best hw decoder with copy-back
option = auto-safe enable any whitelisted hw decoder
-option = dxva2 requires vo=gpu with gpu-context=d3d11, gpu-context=angle or gpu-context=dxinterop (Windows only)
-option = dxva2-copy copies video back to system RAM (Windows only)
-option = d3d11va requires vo=gpu with gpu-context=d3d11 or gpu-context=angle (Windows 8+ only)
-option = d3d11va-copy copies video back to system RAM (Windows 8+ only)
+option = dxva2 requires vo=gpu with gpu-context=d3d11, gpu-context=angle or gpu-context=dxinterop
+option = dxva2-copy copies video back to system RAM
+option = d3d11va requires vo=gpu with gpu-context=d3d11 or gpu-context=angle
+option = d3d11va-copy copies video back to system RAM
option = cuda requires vo=gpu (Any platform CUDA is available)
-option = cuda-copy copies video back to system RAM (Any platform CUDA is available)
+option = cuda-copy copies video back to system RAM
option = nvdec requires vo=gpu (Any platform CUDA is available)
-option = nvdec-copy copies video back to system RAM (Any platform CUDA is available)
+option = nvdec-copy copies video back to system RAM
name = gpu-api
file = mpv
@@ -122,48 +122,51 @@ name = d3d11va-zero-copy
file = mpv
default = no
directory = Video
-help = By default, when using hardware decoding with --gpu-api=d3d11, the video image will be copied (GPU-to-GPU) from the decoder surface to a shader resource. Set this option to avoid that copy by sampling directly from the decoder image. This may increase performance and reduce power usage, but can cause the image to be sampled incorrectly on the bottom and right edges due to padding, and may invoke driver bugs, since Direct3D 11 technically does not allow sampling from a decoder surface (though most drivers support it.)
+url = https://mpv.io/manual/master/#options-d3d11va-zero-copy
option = yes
option = no
name = scale
file = mpv
-default = bilinear
+default = lanczos
directory = Video/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).
+url = https://mpv.io/manual/master/#options-scale
+option = bilinear
+option = spline36
+option = lanczos
+option = ewa_lanczos
+option = ewa_lanczossharp
+option = mitchell
+option = oversample
name = cscale
file = mpv
default = bilinear
directory = Video/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).
+url = https://mpv.io/manual/master/#options-cscale
+option = bilinear
+option = spline36
+option = lanczos
+option = ewa_lanczos
+option = ewa_lanczossharp
+option = mitchell
+option = oversample
name = dscale
file = mpv
-default =
+default = lanczos
directory = Video/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).
+url = https://mpv.io/manual/master/#options-dscale
+option = bilinear
+option = spline36
+option = lanczos
+option = ewa_lanczos
+option = ewa_lanczossharp
+option = mitchell
+option = oversample
name = dither-depth
file = mpv
@@ -203,7 +206,7 @@ name = hdr-compute-peak
file = mpv
default = auto
directory = Video/Render Options
-help = Compute the HDR peak and frame average brightness per-frame instead of relying on tagged metadata. These values are averaged over local regions as well as over several frames to prevent the value from jittering around too much. This option basically gives you dynamic, per-scene tone mapping. Requires compute shaders, which is a fairly recent OpenGL feature, and will probably also perform horribly on some drivers, so enable at your own risk. The special value auto (default) will enable HDR peak computation automatically if compute shaders and SSBOs are supported.
+url = https://mpv.io/manual/master/#options-hdr-compute-peak
option = auto
option = yes
option = no
@@ -212,7 +215,7 @@ name = allow-delayed-peak-detect
file = mpv
default = yes
directory = Video/Render Options
-help = When using --hdr-compute-peak, allow delaying the detected peak by a frame when beneficial for performance. In particular, this is required to avoid an unnecessary FBO indirection when no advanced rendering is required otherwise. Has no effect if there already is an indirect pass, such as when advanced scaling is enabled. (Only affects --vo=gpu-next, note that --vo=gpu always delays the peak.)
+url = https://mpv.io/manual/master/#options-allow-delayed-peak-detect
option = yes
option = no
@@ -242,6 +245,7 @@ directory = Video/libplacebo/Scaling
default = default
help = Sets the filter used for upscaling. Defaults to lanczos.
url = https://libplacebo.org/options/#upscalerfilter
+option-name-width = 135
option = default Default.
option = none No filter, only use basic GPU texture sampling.
option = nearest Nearest-neighbour (box) sampling (very fast).
@@ -260,7 +264,7 @@ file = mpv
width = 500
type = folder
directory = Video/Screenshot
-help = Store screenshots in this directory. This path is joined with the filename generated by screenshot-template. If the template filename is already absolute, the directory is ignored.\n\nIf the directory does not exist, it is created on the first screenshot. If it is not a directory, an error is generated when trying to write a screenshot.
+help = Store screenshots in this directory. This path is joined with the filename generated by screenshot-template. If the template filename is already absolute, the directory is ignored.
name = screenshot-format
file = mpv
@@ -333,7 +337,7 @@ name = alang
file = mpv
directory = Audio
type = string
-help = Specify a priority list of audio languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two-letter language codes, Matroska, MPEG-TS and NUT use ISO 639-2 three-letter language codes, while OGM uses a free-form identifier. See also aid.\n\nExamples\n\nmpv dvd://1 alang=hu,en chooses the Hungarian language track on a DVD and falls back on English if Hungarian is not available.\n\nmpv alang=jpn example.mkv plays a Matroska file with Japanese audio.
+help = Specify a priority list of audio languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two-letter language codes, Matroska, MPEG-TS and NUT use ISO 639-2 three-letter language codes, while OGM uses a free-form identifier. See also aid.
name = audio-file-auto
file = mpv
diff --git a/src/MpvNet.Windows/Settings.cs b/src/MpvNet.Windows/Settings.cs
index e6c4d68..ecd9500 100644
--- a/src/MpvNet.Windows/Settings.cs
+++ b/src/MpvNet.Windows/Settings.cs
@@ -16,6 +16,7 @@ public abstract class Setting
public string? Value { get; set; }
public int Width { get; set; }
+ public int OptionNameWidth { get; set; } = 100;
public ConfItem? ConfItem { get; set; }
}
@@ -35,12 +36,13 @@ public class OptionSettingOption
public string? Name { get; set; }
public string? Help { get; set; }
+ public int OptionWidth { get => OptionSetting!.OptionNameWidth; }
public OptionSetting? OptionSetting { get; set; }
public string? Text
{
- get => string.IsNullOrEmpty(_text) ? Name : _text;
+ get => _text ?? Name;
set => _text = value;
}
diff --git a/src/MpvNet.Windows/WPF/ComboBoxTemplateSelector.cs b/src/MpvNet.Windows/WPF/ComboBoxTemplateSelector.cs
new file mode 100644
index 0000000..9ba32c1
--- /dev/null
+++ b/src/MpvNet.Windows/WPF/ComboBoxTemplateSelector.cs
@@ -0,0 +1,18 @@
+
+using System.Windows.Controls;
+using System.Windows;
+
+namespace MpvNet.Windows.WPF;
+
+public class ComboBoxTemplateSelector : DataTemplateSelector
+{
+ public override DataTemplate SelectTemplate(object item, DependencyObject container)
+ {
+ ContentPresenter presenter = (ContentPresenter)container;
+
+ if (presenter.TemplatedParent is ComboBox)
+ return (DataTemplate)presenter.FindResource("ComboBoxCollapsedDataTemplate");
+ else // Templated parent is ComboBoxItem
+ return (DataTemplate)presenter.FindResource("ComboBoxExpandedDataTemplate");
+ }
+}
diff --git a/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs b/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs
index 49111ef..e029d5d 100644
--- a/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs
+++ b/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs
@@ -149,7 +149,10 @@ public partial class ConfWindow : Window, INotifyPropertyChanged
MainStackPanel.Children.Add(new StringSettingControl(s) { Visibility = Visibility.Collapsed });
break;
case OptionSetting s:
- MainStackPanel.Children.Add(new OptionSettingControl(s) { Visibility = Visibility.Collapsed });
+ if (s.Options.Count > 3)
+ MainStackPanel.Children.Add(new ComboBoxSettingControl(s) { Visibility = Visibility.Collapsed });
+ else
+ MainStackPanel.Children.Add(new OptionSettingControl(s) { Visibility = Visibility.Collapsed });
break;
}
}
diff --git a/src/MpvNet.Windows/WPF/Controls/ComboBoxSettingControl.xaml b/src/MpvNet.Windows/WPF/Controls/ComboBoxSettingControl.xaml
new file mode 100644
index 0000000..cd861c9
--- /dev/null
+++ b/src/MpvNet.Windows/WPF/Controls/ComboBoxSettingControl.xaml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/MpvNet.Windows/WPF/Controls/ComboBoxSettingControl.xaml.cs b/src/MpvNet.Windows/WPF/Controls/ComboBoxSettingControl.xaml.cs
new file mode 100644
index 0000000..23c1410
--- /dev/null
+++ b/src/MpvNet.Windows/WPF/Controls/ComboBoxSettingControl.xaml.cs
@@ -0,0 +1,69 @@
+
+using System.Windows;
+using System.Windows.Controls;
+
+using MpvNet.Windows.UI;
+
+namespace MpvNet.Windows.WPF;
+
+public partial class ComboBoxSettingControl : UserControl, ISettingControl
+{
+ OptionSetting OptionSetting;
+
+ public ComboBoxSettingControl(OptionSetting optionSetting)
+ {
+ OptionSetting = optionSetting;
+ InitializeComponent();
+ DataContext = this;
+ TitleTextBox.Text = optionSetting.Name;
+
+ if (string.IsNullOrEmpty(optionSetting.Help))
+ HelpTextBox.Visibility = Visibility.Collapsed;
+
+ HelpTextBox.Text = optionSetting.Help;
+ ComboBoxControl.ItemsSource = optionSetting.Options;
+
+ foreach (var item in optionSetting.Options)
+ if (item.Name == optionSetting.Value)
+ ComboBoxControl.SelectedItem = item;
+
+ if (string.IsNullOrEmpty(optionSetting.URL))
+ LinkTextBlock.Visibility = Visibility.Collapsed;
+
+ Link.SetURL(optionSetting.URL);
+ }
+
+ public Theme? Theme => Theme.Current;
+
+ public Setting Setting => OptionSetting;
+
+ public bool Contains(string searchString) => ContainsInternal(searchString.ToLower());
+
+ public bool ContainsInternal(string search)
+ {
+ if (TitleTextBox.Text.IndexOf(search, StringComparison.InvariantCultureIgnoreCase) > -1)
+ return true;
+
+ if (HelpTextBox.Text.IndexOf(search, StringComparison.InvariantCultureIgnoreCase) > -1)
+ return true;
+
+ foreach (var i in OptionSetting.Options)
+ {
+ if (i.Text?.IndexOf(search, StringComparison.InvariantCultureIgnoreCase) > -1)
+ return true;
+
+ if (i.Help?.IndexOf(search, StringComparison.InvariantCultureIgnoreCase) > -1)
+ return true;
+
+ if (i.Name?.IndexOf(search, StringComparison.InvariantCultureIgnoreCase) > -1)
+ return true;
+ }
+
+ return false;
+ }
+
+ void ComboBoxControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ OptionSetting.Value = (ComboBoxControl.SelectedItem as OptionSettingOption)?.Name;
+ }
+}
diff --git a/src/MpvNet.Windows/WPF/Controls/OptionSettingControl.xaml b/src/MpvNet.Windows/WPF/Controls/OptionSettingControl.xaml
index 310d958..0254fbe 100644
--- a/src/MpvNet.Windows/WPF/Controls/OptionSettingControl.xaml
+++ b/src/MpvNet.Windows/WPF/Controls/OptionSettingControl.xaml
@@ -65,9 +65,15 @@
Foreground="{Binding Theme.Foreground}"
Background="{Binding Theme.Background}"
/>
-
-
-
+
+
+
diff --git a/src/MpvNet.Windows/WPF/Controls/OptionSettingControl.xaml.cs b/src/MpvNet.Windows/WPF/Controls/OptionSettingControl.xaml.cs
index 28c86c8..95aa84b 100644
--- a/src/MpvNet.Windows/WPF/Controls/OptionSettingControl.xaml.cs
+++ b/src/MpvNet.Windows/WPF/Controls/OptionSettingControl.xaml.cs
@@ -21,6 +21,10 @@ public partial class OptionSettingControl : UserControl, ISettingControl
HelpTextBox.Visibility = Visibility.Collapsed;
HelpTextBox.Text = optionSetting.Help;
+
+ if (string.IsNullOrEmpty(optionSetting.Help))
+ LinkTextBlock.Margin = new Thickness(2, 6, 0, 0);
+
ItemsControl.ItemsSource = optionSetting.Options;
if (string.IsNullOrEmpty(optionSetting.URL))
diff --git a/src/MpvNet.Windows/WPF/Controls/StringSettingControl.xaml b/src/MpvNet.Windows/WPF/Controls/StringSettingControl.xaml
index 9d32a90..646bd7f 100644
--- a/src/MpvNet.Windows/WPF/Controls/StringSettingControl.xaml
+++ b/src/MpvNet.Windows/WPF/Controls/StringSettingControl.xaml
@@ -60,8 +60,14 @@
Background="{Binding Theme.Background}"
/>
-
-
+
+
diff --git a/src/MpvNet.Windows/WPF/Resources.xaml b/src/MpvNet.Windows/WPF/Resources.xaml
index 5cada96..865ea06 100644
--- a/src/MpvNet.Windows/WPF/Resources.xaml
+++ b/src/MpvNet.Windows/WPF/Resources.xaml
@@ -6,6 +6,183 @@
xmlns:local="clr-namespace:MpvNet.Windows.WPF"
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+