From 39f6f4de0dd2e9da4fed4ef8639e5954a72df66e Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Sat, 6 Apr 2019 02:10:41 +0200 Subject: [PATCH] - --- README.md | 7 ++++--- mpv.net/MainForm.cs | 1 + mpv.net/Resources/input.conf.txt | 18 +++++++++--------- mpvConfEdit/MainWindow.xaml | 2 +- mpvInputEdit/MainWindow.xaml.cs | 16 ++++++++++++++-- mpvInputEdit/SearchTextBoxUserControl.xaml | 2 +- mpvInputEdit/SearchTextBoxUserControl.xaml.cs | 5 ++++- 7 files changed, 34 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e35d817..60bd598 100644 --- a/README.md +++ b/README.md @@ -72,9 +72,10 @@ https://github.com/stax76/mpv.net/wiki/Scripting-(CSharp,-Python,-JavaScript,-Lu ### 2.4 (2019-0?-??) -* new options added to the conf GUI editor: gpu-context, gpu-api, scale, cscale, dscale, dither-depth, correct-downscaling, sigmoid-upscaling, deband -* the conf edit GUI has a 'Apply' feature added to write the conf to mpv.conf without the need to close the conf edit GUI -* the input edit GUI shows a message box when a duplicate is detected and writes help on top of input.conf +- new options added to the conf GUI editor: gpu-context, gpu-api, scale, cscale, dscale, dither-depth, correct-downscaling, sigmoid-upscaling, deband +- the conf edit GUI has a 'Apply' feature added to write the conf to mpv.conf without the need to close the conf edit GUI +- the input edit GUI shows a message box when a duplicate is detected and it has a new feature to narrow the filter scope to eather of input, menu or command and the editor writes always the same help on top of input.conf as it is found in the defaults +- the conf edit GUI was often starting out of working area bounds and is now starting with center screen ### 2.3 (2019-04-04) diff --git a/mpv.net/MainForm.cs b/mpv.net/MainForm.cs index 5ed02cb..366359b 100644 --- a/mpv.net/MainForm.cs +++ b/mpv.net/MainForm.cs @@ -29,6 +29,7 @@ namespace mpvnet Application.ThreadException += Application_ThreadException; Instance = this; Hwnd = Handle; + MinimumSize = new Size(FontHeight * 16, FontHeight * 9); Text += " " + Application.ProductVersion; if (mp.mpvConf.ContainsKey("screen")) diff --git a/mpv.net/Resources/input.conf.txt b/mpv.net/Resources/input.conf.txt index 48f05cf..e3bd301 100644 --- a/mpv.net/Resources/input.conf.txt +++ b/mpv.net/Resources/input.conf.txt @@ -59,20 +59,20 @@ Ctrl+KP2 add video-pan-y 0.01 #menu: Pan & Scan > Move Down _ ignore #menu: Pan & Scan > - w add panscan -0.1 #menu: Pan & Scan > Decrease Height - W add panscan +0.1 #menu: Pan & Scan > Increase Height + W add panscan 0.1 #menu: Pan & Scan > Increase Height _ ignore #menu: Pan & Scan > - - Ctrl+BS set video-zoom 0 ; set video-pan-x 0 ; set video-pan-y 0 #menu: Pan & Scan > Reset + Ctrl+BS set video-zoom 0; set video-pan-x 0; set video-pan-y 0 #menu: Pan & Scan > Reset Ctrl+1 add contrast -1 #menu: Video > Decrease Contrast - Ctrl+2 add contrast 1 #menu: Video > Increase Contrast + Ctrl+2 add contrast #menu: Video > Increase Contrast _ ignore #menu: Video > - Ctrl+3 add brightness -1 #menu: Video > Decrease Brightness - Ctrl+4 add brightness 1 #menu: Video > Increase Brightness + Ctrl+4 add brightness 1 #menu: Video > Increase Brightness _ ignore #menu: Video > - Ctrl+5 add gamma -1 #menu: Video > Decrease Gamma - Ctrl+6 add gamma 1 #menu: Video > Increase Gamma + Ctrl+6 add gamma 1 #menu: Video > Increase Gamma _ ignore #menu: Video > - Ctrl+7 add saturation -1 #menu: Video > Decrease Saturation - Ctrl+8 add saturation 1 #menu: Video > Increase Saturation + Ctrl+8 add saturation 1 #menu: Video > Increase Saturation _ ignore #menu: Video > - Ctrl+s async screenshot #menu: Video > Take Screenshot d cycle deinterlace #menu: Video > Toggle Deinterlace @@ -85,13 +85,13 @@ v cycle sub-visibility #menu: Subtitle > Toggle Visibility _ ignore #menu: Subtitle > - z add sub-delay -0.1 #menu: Subtitle > Delay -0.1 - Z add sub-delay +0.1 #menu: Subtitle > Delay +0.1 + Z add sub-delay 0.1 #menu: Subtitle > Delay +0.1 _ ignore #menu: Subtitle > - r add sub-pos -1 #menu: Subtitle > Move Up R add sub-pos +1 #menu: Subtitle > Move Down _ ignore #menu: Subtitle > - _ add sub-scale -0.1 #menu: Subtitle > Decrease Subtitle Font Size - _ add sub-scale +0.1 #menu: Subtitle > Increase Subtitle Font Size + _ add sub-scale 0.1 #menu: Subtitle > Increase Subtitle Font Size + add volume 10 #menu: Volume > Up - add volume -10 #menu: Volume > Down _ ignore #menu: Volume > - @@ -150,7 +150,7 @@ Forward seek 60 Rewind seek -60 Mute cycle mute - Volume_Up add volume 10 + Volume_Up add volume 10 Volume_Down add volume -10 Wheel_Up add volume 10 Wheel_Down add volume -10 diff --git a/mpvConfEdit/MainWindow.xaml b/mpvConfEdit/MainWindow.xaml index af2439f..d7d135a 100644 --- a/mpvConfEdit/MainWindow.xaml +++ b/mpvConfEdit/MainWindow.xaml @@ -4,7 +4,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" - Height="600" Width="800" Loaded="MainWindow1_Loaded"> + Height="600" Width="800" Loaded="MainWindow1_Loaded" WindowStartupLocation="CenterScreen"> diff --git a/mpvInputEdit/MainWindow.xaml.cs b/mpvInputEdit/MainWindow.xaml.cs index a8852e4..05635dc 100644 --- a/mpvInputEdit/MainWindow.xaml.cs +++ b/mpvInputEdit/MainWindow.xaml.cs @@ -34,10 +34,22 @@ namespace mpvInputEdit bool Filter(InputItem item) { - string searchText = SearchControl.SearchTextBox.Text.ToLowerInvariant(); + string searchText = SearchControl.SearchTextBox.Text.ToLower(); if (searchText == "") return true; - if (item.Command.ToLower().Contains(searchText) || + if (searchText.StartsWith("i ")) + { + searchText = searchText.Substring(2).Trim(); + + if (searchText.Length < 3) + return item.Input.ToLower().Replace("ctrl+", "").Replace("shift+", "").Replace("alt+", "").Contains(searchText); + else + return item.Input.ToLower().Contains(searchText); + } else if (searchText.StartsWith("m ")) + return item.Menu.ToLower().Contains(searchText.Substring(2).Trim()); + else if (searchText.StartsWith("c ")) + return item.Command.ToLower().Contains(searchText.Substring(2).Trim()); + else if (item.Command.ToLower().Contains(searchText) || item.Menu.ToLower().Contains(searchText) || item.Input.ToLower().Contains(searchText)) { diff --git a/mpvInputEdit/SearchTextBoxUserControl.xaml b/mpvInputEdit/SearchTextBoxUserControl.xaml index 0a614da..f277129 100644 --- a/mpvInputEdit/SearchTextBoxUserControl.xaml +++ b/mpvInputEdit/SearchTextBoxUserControl.xaml @@ -6,7 +6,7 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> - + diff --git a/mpvInputEdit/SearchTextBoxUserControl.xaml.cs b/mpvInputEdit/SearchTextBoxUserControl.xaml.cs index d09dd10..c4b3596 100644 --- a/mpvInputEdit/SearchTextBoxUserControl.xaml.cs +++ b/mpvInputEdit/SearchTextBoxUserControl.xaml.cs @@ -21,12 +21,15 @@ namespace Controls private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e) { - SearchTextBlock.Text = SearchTextBox.Text == "" ? "Search" : ""; + SearchHintTextBlock.Text = SearchTextBox.Text == "" ? "Type ? to get help." : ""; if (SearchTextBox.Text == "") SearchClearButton.Visibility = Visibility.Hidden; else SearchClearButton.Visibility = Visibility.Visible; + + if (SearchTextBox.Text == "?") + MessageBox.Show("Use i, m or c to set the filter scope to Input, Menu or Command.", "Filter", MessageBoxButton.OK, MessageBoxImage.Information); } } } \ No newline at end of file