From 0ee8318ca4c86d17a810a59a46ccd10c57eed459 Mon Sep 17 00:00:00 2001 From: stax76 Date: Tue, 12 Dec 2023 18:15:20 +0100 Subject: [PATCH] some bug fixes --- docs/changelog.md | 8 ++ .../Images/LockScreenLogo.scale-200.png | Bin .../Images/SplashScreen.scale-200.png | Bin .../Images/Square150x150Logo.scale-200.png | Bin .../Images/Square44x44Logo.scale-200.png | Bin ...x44Logo.targetsize-24_altform-unplated.png | Bin .../Package => MSIX}/Images/StoreLogo.png | Bin .../Images/Wide310x150Logo.scale-200.png | Bin .../MSIX.wapproj} | 23 ++--- .../Package => MSIX}/Package.appxmanifest | 0 src/MpvNet.Windows/MpvNet.Windows.csproj | 14 ++- src/MpvNet.Windows/WPF/ConfWindow.xaml.cs | 13 +-- src/MpvNet.Windows/WinForms/MainForm.cs | 34 ++++--- src/MpvNet.sln | 88 ++++++++++++++++++ src/MpvNet/InputHelp.cs | 42 +++++++++ src/MpvNet/Player.cs | 1 - 16 files changed, 177 insertions(+), 46 deletions(-) rename src/{MpvNet.Windows/Package => MSIX}/Images/LockScreenLogo.scale-200.png (100%) rename src/{MpvNet.Windows/Package => MSIX}/Images/SplashScreen.scale-200.png (100%) rename src/{MpvNet.Windows/Package => MSIX}/Images/Square150x150Logo.scale-200.png (100%) rename src/{MpvNet.Windows/Package => MSIX}/Images/Square44x44Logo.scale-200.png (100%) rename src/{MpvNet.Windows/Package => MSIX}/Images/Square44x44Logo.targetsize-24_altform-unplated.png (100%) rename src/{MpvNet.Windows/Package => MSIX}/Images/StoreLogo.png (100%) rename src/{MpvNet.Windows/Package => MSIX}/Images/Wide310x150Logo.scale-200.png (100%) rename src/{MpvNet.Windows/Package/mpv.net.package.wapproj => MSIX/MSIX.wapproj} (80%) rename src/{MpvNet.Windows/Package => MSIX}/Package.appxmanifest (100%) diff --git a/docs/changelog.md b/docs/changelog.md index 6543a52..f5e1034 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,4 +1,12 @@ +# v7.0.0.2 Beta (2023-12-??) + +- Fix dynamic menu items missing in context menu. +- Fix certain binding setups shown poorly or incorrect in the main menu. +- Fix conf editor not remembering the search text. +- Fix quit-watch-later not working. +- New zhongfly libmpv build. + # v7.0.0.1 Beta (2023-12-11) - [.NET 6 is a new requirement](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) diff --git a/src/MpvNet.Windows/Package/Images/LockScreenLogo.scale-200.png b/src/MSIX/Images/LockScreenLogo.scale-200.png similarity index 100% rename from src/MpvNet.Windows/Package/Images/LockScreenLogo.scale-200.png rename to src/MSIX/Images/LockScreenLogo.scale-200.png diff --git a/src/MpvNet.Windows/Package/Images/SplashScreen.scale-200.png b/src/MSIX/Images/SplashScreen.scale-200.png similarity index 100% rename from src/MpvNet.Windows/Package/Images/SplashScreen.scale-200.png rename to src/MSIX/Images/SplashScreen.scale-200.png diff --git a/src/MpvNet.Windows/Package/Images/Square150x150Logo.scale-200.png b/src/MSIX/Images/Square150x150Logo.scale-200.png similarity index 100% rename from src/MpvNet.Windows/Package/Images/Square150x150Logo.scale-200.png rename to src/MSIX/Images/Square150x150Logo.scale-200.png diff --git a/src/MpvNet.Windows/Package/Images/Square44x44Logo.scale-200.png b/src/MSIX/Images/Square44x44Logo.scale-200.png similarity index 100% rename from src/MpvNet.Windows/Package/Images/Square44x44Logo.scale-200.png rename to src/MSIX/Images/Square44x44Logo.scale-200.png diff --git a/src/MpvNet.Windows/Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png b/src/MSIX/Images/Square44x44Logo.targetsize-24_altform-unplated.png similarity index 100% rename from src/MpvNet.Windows/Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png rename to src/MSIX/Images/Square44x44Logo.targetsize-24_altform-unplated.png diff --git a/src/MpvNet.Windows/Package/Images/StoreLogo.png b/src/MSIX/Images/StoreLogo.png similarity index 100% rename from src/MpvNet.Windows/Package/Images/StoreLogo.png rename to src/MSIX/Images/StoreLogo.png diff --git a/src/MpvNet.Windows/Package/Images/Wide310x150Logo.scale-200.png b/src/MSIX/Images/Wide310x150Logo.scale-200.png similarity index 100% rename from src/MpvNet.Windows/Package/Images/Wide310x150Logo.scale-200.png rename to src/MSIX/Images/Wide310x150Logo.scale-200.png diff --git a/src/MpvNet.Windows/Package/mpv.net.package.wapproj b/src/MSIX/MSIX.wapproj similarity index 80% rename from src/MpvNet.Windows/Package/mpv.net.package.wapproj rename to src/MSIX/MSIX.wapproj index 4ef7cbc..1f08ac6 100644 --- a/src/MpvNet.Windows/Package/mpv.net.package.wapproj +++ b/src/MSIX/MSIX.wapproj @@ -23,13 +23,13 @@ 10.0.14393.0 en-US false - ..\mpv.net.csproj False False True x64 True 0 + ..\MpvNet.Windows\MpvNet.Windows.csproj Always @@ -43,20 +43,16 @@ - - mpv.net\MediaInfo.dll + + libmpv-2.dll PreserveNewest - - mpv.net\Microsoft.Management.Infrastructure.dll + + MediaInfo.dll PreserveNewest - - mpv.net\libmpv-2.dll - PreserveNewest - - - mpv.net\mpvnet.com + + mpvnet.com PreserveNewest @@ -66,13 +62,12 @@ - - + - + \ No newline at end of file diff --git a/src/MpvNet.Windows/Package/Package.appxmanifest b/src/MSIX/Package.appxmanifest similarity index 100% rename from src/MpvNet.Windows/Package/Package.appxmanifest rename to src/MSIX/Package.appxmanifest diff --git a/src/MpvNet.Windows/MpvNet.Windows.csproj b/src/MpvNet.Windows/MpvNet.Windows.csproj index beb00e9..7d8c73b 100644 --- a/src/MpvNet.Windows/MpvNet.Windows.csproj +++ b/src/MpvNet.Windows/MpvNet.Windows.csproj @@ -11,11 +11,19 @@ true mpv-icon.ico mpv.net - 7.0.0.1 7.0.0.1 + 7.0.0.1 + 7.0.0.1 enable + + + + + + + @@ -38,8 +46,4 @@ - - - - diff --git a/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs b/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs index 3a60529..7be26f7 100644 --- a/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs +++ b/src/MpvNet.Windows/WPF/ConfWindow.xaml.cs @@ -38,9 +38,9 @@ public partial class ConfWindow : Window, INotifyPropertyChanged InitialContent = GetCompareString(); if (string.IsNullOrEmpty(App.Settings.ConfigEditorSearch)) - SearchControl.Text = "General:"; + SearchText = "General:"; else - SearchControl.Text = App.Settings.ConfigEditorSearch; + SearchText = App.Settings.ConfigEditorSearch; foreach (var node in Nodes) SelectNodeFromSearchText(node); @@ -155,7 +155,7 @@ public partial class ConfWindow : Window, INotifyPropertyChanged protected override void OnClosed(EventArgs e) { base.OnClosed(e); - App.Settings.ConfigEditorSearch = SearchControl.Text; + App.Settings.ConfigEditorSearch = SearchText; if (InitialContent == GetCompareString()) return; @@ -319,9 +319,6 @@ public partial class ConfWindow : Window, INotifyPropertyChanged } } - if (!sb.ToString().Contains("# Editor")) - sb.AppendLine("# Editor"); - foreach (Setting setting in Settings) { if (filename != setting.File || namesWritten.Contains(setting.Name!)) @@ -443,7 +440,7 @@ public partial class ConfWindow : Window, INotifyPropertyChanged void SelectNodeFromSearchText(NodeViewModel node) { - if (node.Path + ":" == SearchControl.Text) + if (node.Path + ":" == SearchText) { node.IsSelected = true; return; @@ -470,7 +467,7 @@ public partial class ConfWindow : Window, INotifyPropertyChanged ExpandNode(it); } - [RelayCommand] void ShowMpvNetSpecificSettings() => SearchControl.Text = "mpv.net"; + [RelayCommand] void ShowMpvNetSpecificSettings() => SearchText = "mpv.net"; [RelayCommand] void PreviewMpvConfFile() => Msg.ShowInfo(GetContent("mpv")); diff --git a/src/MpvNet.Windows/WinForms/MainForm.cs b/src/MpvNet.Windows/WinForms/MainForm.cs index 3a872bc..5a1cfea 100644 --- a/src/MpvNet.Windows/WinForms/MainForm.cs +++ b/src/MpvNet.Windows/WinForms/MainForm.cs @@ -27,7 +27,6 @@ public partial class MainForm : Form public SnapManager SnapManager = new SnapManager(); public IntPtr MpvWindowHandle { get; set; } public ElementHost? CommandPaletteHost { get; set; } - public Dictionary MenuItemDuplicate = new Dictionary(); public bool WasShown { get; set; } public static MainForm? Instance { get; set; } WpfControls.ContextMenu ContextMenu { get; } = new WpfControls.ContextMenu(); @@ -286,7 +285,7 @@ public partial class MainForm : Form lock (Player.MediaTracksLock) { - var trackMenuItem = FindMenuItem(_("Track")); + var trackMenuItem = FindMenuItem(_("Track"), "Track"); if (trackMenuItem != null) { @@ -348,7 +347,7 @@ public partial class MainForm : Form } } - var chaptersMenuItem = FindMenuItem(_("Chapter")); + var chaptersMenuItem = FindMenuItem(_("Chapter"), "Chapters"); if (chaptersMenuItem != null) { @@ -369,7 +368,7 @@ public partial class MainForm : Form } } - var recentMenuItem = FindMenuItem(_("Recent Files")); + var recentMenuItem = FindMenuItem(_("Recent Files"), "Recent"); if (recentMenuItem != null) { @@ -391,7 +390,7 @@ public partial class MainForm : Form recentMenuItem.Items.Add(clearMenuItem); } - var titlesMenuItem = FindMenuItem(_("Title")); + var titlesMenuItem = FindMenuItem(_("Title"), "Titles"); if (titlesMenuItem != null) { @@ -424,7 +423,7 @@ public partial class MainForm : Form } } - var profilesMenuItem = FindMenuItem(_("Profile")); + var profilesMenuItem = FindMenuItem(_("Profile"), "Profile"); if (profilesMenuItem != null && !profilesMenuItem.HasItems) { @@ -446,7 +445,7 @@ public partial class MainForm : Form } } - var customMenuItem = FindMenuItem(_("Custom")); + var customMenuItem = FindMenuItem(_("Custom"), "Custom"); if (customMenuItem != null) { @@ -476,7 +475,14 @@ public partial class MainForm : Form } } - public WpfControls.MenuItem? FindMenuItem(string text) => FindMenuItem(text, ContextMenu.Items); + public WpfControls.MenuItem? FindMenuItem(string text, string text2 = "") { + var ret = FindMenuItem(text, ContextMenu.Items); + + if (ret == null && text2 != "") + return FindMenuItem(text2, ContextMenu.Items); + + return ret; + } WpfControls.MenuItem? FindMenuItem(string text, WpfControls.ItemCollection? items) { @@ -767,17 +773,12 @@ public partial class MainForm : Form var (menuBindings, confBindings) = App.InputConf.GetBindings(); _confBindings = confBindings; + var activeBindings = InputHelp.GetActiveBindings(menuBindings); foreach (Binding binding in menuBindings) { Binding tempBinding = binding; - if (MenuItemDuplicate.ContainsKey(tempBinding.Command) && tempBinding.Input != "") - { - var mi = MenuItemDuplicate[tempBinding.Command]; - mi.InputGestureText = mi.InputGestureText + ", " + tempBinding.Input; - } - if (!binding.IsMenu) continue; @@ -785,9 +786,6 @@ public partial class MainForm : Form if (menuItem != null) { - if (tempBinding.Input != "") - MenuItemDuplicate[tempBinding.Command] = menuItem; - menuItem.Click += (sender, args) => { try { TaskHelp.Run(() => { @@ -803,7 +801,7 @@ public partial class MainForm : Form } }; - menuItem.InputGestureText = tempBinding.Input; + menuItem.InputGestureText = InputHelp.GetBindingsForCommand(activeBindings, tempBinding.Command); } } diff --git a/src/MpvNet.sln b/src/MpvNet.sln index cdd93b6..eb10a3f 100644 --- a/src/MpvNet.sln +++ b/src/MpvNet.sln @@ -17,24 +17,112 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NGettext.Wpf", "NGettext.Wpf\NGettext.Wpf.csproj", "{0B7958FD-2138-482A-A21B-481AE7A0F851}" EndProject +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "MSIX", "MSIX\MSIX.wapproj", "{81DAEE3A-76FF-4494-9384-D28A651D70BB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|ARM.ActiveCfg = Debug|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|ARM.Build.0 = Debug|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|ARM64.Build.0 = Debug|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|x64.ActiveCfg = Debug|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|x64.Build.0 = Debug|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|x86.ActiveCfg = Debug|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|x86.Build.0 = Debug|Any CPU {ADC341B5-863A-4DFB-9352-475518FABE91}.Release|Any CPU.ActiveCfg = Release|Any CPU {ADC341B5-863A-4DFB-9352-475518FABE91}.Release|Any CPU.Build.0 = Release|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Release|ARM.ActiveCfg = Release|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Release|ARM.Build.0 = Release|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Release|ARM64.ActiveCfg = Release|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Release|ARM64.Build.0 = Release|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Release|x64.ActiveCfg = Release|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Release|x64.Build.0 = Release|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Release|x86.ActiveCfg = Release|Any CPU + {ADC341B5-863A-4DFB-9352-475518FABE91}.Release|x86.Build.0 = Release|Any CPU {0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|ARM.ActiveCfg = Debug|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|ARM.Build.0 = Debug|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|ARM64.Build.0 = Debug|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|x64.ActiveCfg = Debug|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|x64.Build.0 = Debug|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|x86.ActiveCfg = Debug|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|x86.Build.0 = Debug|Any CPU {0B524801-DA28-433F-808D-3F74EF81EB53}.Release|Any CPU.ActiveCfg = Release|Any CPU {0B524801-DA28-433F-808D-3F74EF81EB53}.Release|Any CPU.Build.0 = Release|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Release|ARM.ActiveCfg = Release|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Release|ARM.Build.0 = Release|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Release|ARM64.ActiveCfg = Release|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Release|ARM64.Build.0 = Release|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Release|x64.ActiveCfg = Release|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Release|x64.Build.0 = Release|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Release|x86.ActiveCfg = Release|Any CPU + {0B524801-DA28-433F-808D-3F74EF81EB53}.Release|x86.Build.0 = Release|Any CPU {0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|ARM.ActiveCfg = Debug|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|ARM.Build.0 = Debug|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|ARM64.Build.0 = Debug|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|x64.ActiveCfg = Debug|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|x64.Build.0 = Debug|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|x86.ActiveCfg = Debug|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|x86.Build.0 = Debug|Any CPU {0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|Any CPU.ActiveCfg = Release|Any CPU {0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|Any CPU.Build.0 = Release|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|ARM.ActiveCfg = Release|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|ARM.Build.0 = Release|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|ARM64.ActiveCfg = Release|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|ARM64.Build.0 = Release|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|x64.ActiveCfg = Release|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|x64.Build.0 = Release|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|x86.ActiveCfg = Release|Any CPU + {0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|x86.Build.0 = Release|Any CPU + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|Any CPU.ActiveCfg = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|Any CPU.Build.0 = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|Any CPU.Deploy.0 = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM.ActiveCfg = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM.Build.0 = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM.Deploy.0 = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM64.ActiveCfg = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM64.Build.0 = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM64.Deploy.0 = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x64.ActiveCfg = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x64.Build.0 = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x64.Deploy.0 = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x86.ActiveCfg = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x86.Build.0 = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x86.Deploy.0 = Debug|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|Any CPU.ActiveCfg = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|Any CPU.Build.0 = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|Any CPU.Deploy.0 = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM.ActiveCfg = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM.Build.0 = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM.Deploy.0 = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM64.ActiveCfg = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM64.Build.0 = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM64.Deploy.0 = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x64.ActiveCfg = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x64.Build.0 = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x64.Deploy.0 = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x86.ActiveCfg = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x86.Build.0 = Release|x64 + {81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x86.Deploy.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/MpvNet/InputHelp.cs b/src/MpvNet/InputHelp.cs index 37ac4cb..759cabf 100644 --- a/src/MpvNet/InputHelp.cs +++ b/src/MpvNet/InputHelp.cs @@ -454,4 +454,46 @@ public static class InputHelp } return bindings; } + + public static Dictionary GetActiveBindings(List bindings) + { + Dictionary ret = new(); + + foreach (Binding binding in bindings) + { + if (binding.Input == "" || binding.Command == "") + continue; + + ret[binding.Input] = binding; + } + + return ret; + } + + public static string GetBindingsForCommand(Dictionary activeBindings, string command) + { + List keys = new(); + bool hasLongKeys = false; + + foreach (var it in activeBindings) + { + if (it.Value.Command != command) + continue; + + Binding binding = it.Value; + + if (binding.Input.Length > 8) + hasLongKeys = true; + else + if (!keys.Contains(binding.Input)) + keys.Add(binding.Input); + } + + string ret = string.Join(", ", keys); + + if (hasLongKeys && keys.Count > 0) + ret += ", ..."; + + return ret; + } } diff --git a/src/MpvNet/Player.cs b/src/MpvNet/Player.cs index d595732..1d4e83b 100644 --- a/src/MpvNet/Player.cs +++ b/src/MpvNet/Player.cs @@ -98,7 +98,6 @@ public class MainPlayer : MpvClient SetPropertyBool("input-default-bindings", true); SetPropertyBool("input-builtin-bindings", false); - SetPropertyString("watch-later-options", "mute"); SetPropertyString("screenshot-directory", "~~desktop/"); SetPropertyString("osd-playing-msg", "${media-title}"); SetPropertyString("osc", "yes");