From f61eef8961f37a2a790492eea1edd4cfca214b8a Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Sun, 10 May 2020 07:01:59 +0200 Subject: [PATCH] 5.4.7.4 Beta --- Changelog.md | 9 ++++++- mpv.net/Misc/App.cs | 2 -- mpv.net/Misc/Help.cs | 27 +++++++++----------- mpv.net/Misc/Misc.cs | 2 -- mpv.net/Properties/AssemblyInfo.cs | 4 +-- mpv.net/Resources/editor.toml.txt | 13 +--------- mpv.net/Resources/input.conf.txt | 40 +++++++++++++++++------------- mpv.net/WPF/LearnWindow.xaml.cs | 4 +-- mpv.net/WinForms/MainForm.cs | 28 ++++++++------------- mpv.net/mpv/Core.cs | 1 - 10 files changed, 58 insertions(+), 72 deletions(-) diff --git a/Changelog.md b/Changelog.md index fe60077..9815096 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,8 +1,15 @@ +5.4.7.5 Beta (not yet released) +============ + + + + 5.4.7.4 Beta (not yet released) ============ -- +- the media key issue should now be fixed! +- libmpv and youtube-dl update 5.4.7.3 Beta diff --git a/mpv.net/Misc/App.cs b/mpv.net/Misc/App.cs index 3574ff5..fc51754 100644 --- a/mpv.net/Misc/App.cs +++ b/mpv.net/Misc/App.cs @@ -24,7 +24,6 @@ namespace mpvnet public static string DarkTheme { get; set; } = "dark"; public static string LightTheme { get; set; } = "light"; public static string StartSize { get; set; } = "previous"; - public static string MediaKeys { get; set; } = "mpvnet"; public static bool RememberPosition { get; set; } public static bool DebugMode { get; set; } @@ -178,7 +177,6 @@ namespace mpvnet case "auto-load-folder": AutoLoadFolder = value == "yes"; return true; case "update-check": UpdateCheck = value == "yes"; return true; case "start-size": StartSize = value; return true; - case "media-keys": MediaKeys = value; return true; case "process-instance": ProcessInstance = value; return true; case "dark-mode": DarkMode = value; return true; case "start-threshold": StartThreshold = value.Int(); return true; diff --git a/mpv.net/Misc/Help.cs b/mpv.net/Misc/Help.cs index 623439c..cd19bfa 100644 --- a/mpv.net/Misc/Help.cs +++ b/mpv.net/Misc/Help.cs @@ -87,25 +87,22 @@ namespace mpvnet { switch (value) { - case 51: return "CHANNEL_UP"; // MEDIA_CHANNEL_UP - case 52: return "CHANNEL_DOWN"; // MEDIA_CHANNEL_DOWN - case 49: return "FORWARD"; // MEDIA_FAST_FORWARD - case 50: return "REWIND"; // MEDIA_REWIND - case 46: return "PLAY"; // MEDIA_PLAY - case 14: return "PLAYPAUSE"; // MEDIA_PLAY_PAUSE - case 47: return "PAUSE"; // MEDIA_PAUSE + case 5: return "SEARCH"; // BROWSER_SEARCH + case 6: return "FAVORITES"; // BROWSER_FAVORITES + case 7: return "HOMEPAGE"; // BROWSER_HOME + case 15: return "MAIL"; // LAUNCH_MAIL + case 33: return "PRINT"; // PRINT case 11: return "NEXT"; // MEDIA_NEXTTRACK case 12: return "PREV"; // MEDIA_PREVIOUSTRACK case 13: return "STOP"; // MEDIA_STOP + case 14: return "PLAYPAUSE"; // MEDIA_PLAY_PAUSE + case 46: return "PLAY"; // MEDIA_PLAY + case 47: return "PAUSE"; // MEDIA_PAUSE case 48: return "RECORD"; // MEDIA_RECORD - case 1: return "VOLUME_UP"; // VOLUME_UP - case 9: return "VOLUME_DOWN"; // VOLUME_DOWN - case 8: return "MUTE"; // VOLUME_MUTE - case 7: return "HOMEPAGE"; // BROWSER_HOME - case 15: return "MAIL"; // LAUNCH_MAIL - case 6: return "FAVORITES"; // BROWSER_FAVORITES - case 5: return "SEARCH"; // BROWSER_SEARCH - case 33: return "PRINT"; // PRINT + case 49: return "FORWARD"; // MEDIA_FAST_FORWARD + case 50: return "REWIND"; // MEDIA_REWIND + case 51: return "CHANNEL_UP"; // MEDIA_CHANNEL_UP + case 52: return "CHANNEL_DOWN"; // MEDIA_CHANNEL_DOWN } return null; diff --git a/mpv.net/Misc/Misc.cs b/mpv.net/Misc/Misc.cs index ebd5103..3696eec 100644 --- a/mpv.net/Misc/Misc.cs +++ b/mpv.net/Misc/Misc.cs @@ -1,10 +1,8 @@  -using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; -using System.Drawing; using System.IO; using System.Linq; using System.Runtime.CompilerServices; diff --git a/mpv.net/Properties/AssemblyInfo.cs b/mpv.net/Properties/AssemblyInfo.cs index b15f679..1e9d7d1 100644 --- a/mpv.net/Properties/AssemblyInfo.cs +++ b/mpv.net/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("5.4.7.3")] -[assembly: AssemblyFileVersion("5.4.7.3")] +[assembly: AssemblyVersion("5.4.7.4")] +[assembly: AssemblyFileVersion("5.4.7.4")] diff --git a/mpv.net/Resources/editor.toml.txt b/mpv.net/Resources/editor.toml.txt index 81963bb..a619181 100644 --- a/mpv.net/Resources/editor.toml.txt +++ b/mpv.net/Resources/editor.toml.txt @@ -314,7 +314,7 @@ options = [{ name = "yes" }, name = "autofit" file = "mpv" filter = "Screen" -help = " Initial window height in percent. Default: 50" +help = " Initial window height in percent. Default: 60" [[settings]] name = "autofit-smaller" @@ -528,17 +528,6 @@ file = "mpv" filter = "Input" help = "Number of key presses to generate per second on autorepeat." -[[settings]] -name = "media-keys" -file = "mpvnet" -default = "mpvnet" -filter = "Input" -help = "Defines how WM_APPCOMMAND messages are handled. (mpv.net specific setting)" -options = [{ name = "discard", help = "Blocks WM_APPCOMMAND messages, virtual key codes are still processed." }, - { name = "pass", help = "Let WM_APPCOMMAND messages pass to default handling." }, - { name = "mpv", help = "Forward WM_APPCOMMAND messages to libmpv." }, - { name = "mpvnet", help = "Translate WM_APPCOMMAND messages to mpv keys and send as keypress command." }] - [[settings]] name = "update-check" file = "mpvnet" diff --git a/mpv.net/Resources/input.conf.txt b/mpv.net/Resources/input.conf.txt index 6c52370..b5c69af 100644 --- a/mpv.net/Resources/input.conf.txt +++ b/mpv.net/Resources/input.conf.txt @@ -1,22 +1,31 @@ - # This file defines the key and mouse bindings and the context menu - # of mpv.net. A input and config editor can be found in mpv.nets - # context menu under 'Settings'. The defaults of this file can be found at: - - # https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt - - # The defaults of mpv can be found at: - - # https://github.com/mpv-player/mpv/blob/master/etc/input.conf - - # mpv.net's defaults of mpv.conf contain: 'input-default-bindings = no' - # which disables mpv's input defaults. Every line in this file begins with a + # This file defines the key and mouse bindings and the context menu of mpv.net. + + # A convenient input and config editor can be found in the context menu of mpv.net + # under 'Settings'. + + # The mpv.conf defaults of mpv.net contain: 'input-default-bindings = no' + # which disables the input defaults of mpv. Every line in this file begins with a # space character to make it easier to do a text search, so if you want to know # if 'o' has already a binding you can do a text search on ' o '. - # mpv input commands: https://mpv.io/manual/master/#list-of-input-commands + # input test mode: + # mpvnet --input-test - # run mpv.net in input test mode with: mpvnet --input-test + # input key list: + # mpv --input-keylist + + # mpv.net input.conf defaults: + # https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/input.conf.txt + + # mpv input.conf defaults: + # https://github.com/mpv-player/mpv/blob/master/etc/input.conf + + # mpv input commands: + # https://mpv.io/manual/master/#list-of-input-commands + + # mpv input options: + # https://mpv.io/manual/master/#input o script-message mpv.net open-files #menu: Open > Open Files... u script-message mpv.net open-url #menu: Open > Open URL or file path from clipboard @@ -180,9 +189,6 @@ Stop stop Forward seek 60 Rewind seek -60 - Mute cycle mute - Volume_Up add volume 10 - Volume_Down add volume -10 Wheel_Up add volume 10 Wheel_Down add volume -10 Wheel_Left add volume -10 diff --git a/mpv.net/WPF/LearnWindow.xaml.cs b/mpv.net/WPF/LearnWindow.xaml.cs index d3c637b..7d26ce5 100644 --- a/mpv.net/WPF/LearnWindow.xaml.cs +++ b/mpv.net/WPF/LearnWindow.xaml.cs @@ -99,8 +99,6 @@ namespace mpvnet text = "NEXT"; break; case WinForms.Keys.MediaPreviousTrack: text = "PREV"; break; - case WinForms.Keys.VolumeMute: - text = "MUTE"; break; case WinForms.Keys.BrowserHome: text = "HOMEPAGE"; break; case WinForms.Keys.LaunchMail: @@ -114,8 +112,8 @@ namespace mpvnet case WinForms.Keys.Cancel: text = "CANCEL"; break; case WinForms.Keys.VolumeUp: - text = ""; break; case WinForms.Keys.VolumeDown: + case WinForms.Keys.VolumeMute: text = ""; break; } diff --git a/mpv.net/WinForms/MainForm.cs b/mpv.net/WinForms/MainForm.cs index 9b76029..d9c7368 100644 --- a/mpv.net/WinForms/MainForm.cs +++ b/mpv.net/WinForms/MainForm.cs @@ -527,23 +527,14 @@ namespace mpvnet break; case 0x319: // WM_APPCOMMAND { - if (App.MediaKeys == "discard") { + string value = mpvHelp.WM_APPCOMMAND_to_mpv_key((int)(m.LParam.ToInt64() >> 16 & ~0xf000)); + + if (value != null) + { + core.command("keypress " + value); m.Result = new IntPtr(1); + LastAppCommand = Environment.TickCount; return; - } else if (App.MediaKeys == "mpv") { - if (core.WindowHandle != IntPtr.Zero) { - m.Result = WinAPI.SendMessage(core.WindowHandle, m.Msg, m.WParam, m.LParam); - if (m.Result != IntPtr.Zero) - return; - } - } else if (App.MediaKeys == "mpvnet") { - string value = mpvHelp.WM_APPCOMMAND_to_mpv_key((int)(m.LParam.ToInt64() >> 16 & ~0xf000)); - if (value != null) { - core.command("keypress " + value); - m.Result = new IntPtr(1); - LastAppCommand = Environment.TickCount; - return; - } } } break; @@ -630,7 +621,9 @@ namespace mpvnet ProgressTimer.Start(); } - base.WndProc(ref m); + // beep sound when closed using taskbar due to exception + //if (!IsDisposed) + base.WndProc(ref m); } void CursorTimer_Tick(object sender, EventArgs e) @@ -863,8 +856,9 @@ namespace mpvnet protected override void OnKeyDown(KeyEventArgs e) { + // prevent beep using alt key if (Control.ModifierKeys == Keys.Alt) - e.SuppressKeyPress = true; // prevent beep using alt key + e.SuppressKeyPress = true; base.OnKeyDown(e); } diff --git a/mpv.net/mpv/Core.cs b/mpv.net/mpv/Core.cs index 43553c9..ed554e0 100644 --- a/mpv.net/mpv/Core.cs +++ b/mpv.net/mpv/Core.cs @@ -130,7 +130,6 @@ namespace mpvnet set_property_string("wid", MainForm.Hwnd.ToString()); set_property_string("osc", "yes"); - set_property_string("input-media-keys", "yes"); set_property_string("force-window", "yes"); set_property_string("config-dir", ConfigFolder); set_property_string("config", "yes");