From c93647841e3ae6025013a897c9cb0654597478cb Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Sat, 25 May 2019 23:54:53 +0200 Subject: [PATCH] - --- README.md | 7 ++ mpv.net/Misc/Command.cs | 5 +- mpv.net/Properties/Resources.Designer.cs | 79 +++++++++++++++++++++++ mpv.net/Properties/Resources.resx | 3 + mpv.net/Resources/mpvnet.png | Bin 0 -> 6903 bytes mpv.net/WinForms/MainForm.cs | 8 ++- mpv.net/mpv.net.csproj | 1 + mpv.net/mpv/mp.cs | 60 +++++++++++++---- 8 files changed, 147 insertions(+), 16 deletions(-) create mode 100644 mpv.net/Resources/mpvnet.png diff --git a/README.md b/README.md index e9401d1..5e0dc15 100644 --- a/README.md +++ b/README.md @@ -201,6 +201,13 @@ mpv.net bugs and requests: ### Changelog +### + +- on the start screen the mpv.net logo is shown instead of the mpv logo +- everytime only one file is opened mpv.net loads the complete folder + in the playlist +- the info command (i key) shows the audio format + ### 3.7 - new icon design diff --git a/mpv.net/Misc/Command.cs b/mpv.net/Misc/Command.cs index cff035d..2908958 100644 --- a/mpv.net/Misc/Command.cs +++ b/mpv.net/Misc/Command.cs @@ -154,7 +154,8 @@ namespace mpvnet TimeSpan position = TimeSpan.FromSeconds(mp.get_property_number("time-pos")); TimeSpan duration2 = TimeSpan.FromSeconds(mp.get_property_number("duration")); - string videoCodec = mp.get_property_string("video-format").ToUpper(); + string videoFormat = mp.get_property_string("video-format").ToUpper(); + string audioCodec = mp.get_property_string("audio-codec-name").ToUpper(); text = Path.GetFileName(path) + "\n" + FormatTime(position.TotalMinutes) + ":" + @@ -166,7 +167,7 @@ namespace mpvnet if (fileSize > 0) text += Convert.ToInt32(fileSize / 1024.0 / 1024.0).ToString() + " MB\n"; - text += $"{videoCodec}\n"; + text += $"{videoFormat}\n{audioCodec}"; mp.commandv("show-text", text, "5000"); string FormatTime(double value) => ((int)value).ToString("00"); diff --git a/mpv.net/Properties/Resources.Designer.cs b/mpv.net/Properties/Resources.Designer.cs index 03cf154..e49345d 100644 --- a/mpv.net/Properties/Resources.Designer.cs +++ b/mpv.net/Properties/Resources.Designer.cs @@ -60,30 +60,109 @@ namespace mpvnet.Properties { } } + /// + /// Looks up a localized string similar to + /// # This file defines the input (keys and mouse) bindings of mpv and mpv.net + /// # and it also defines the context menu of mpv.net. mpv.net has an input + /// # editor and an config editor as alternative to editing conf text files. + /// # The input and config editor can be found in mpv.net's context menu at: + /// + /// # Settings > Show Config Editor + /// # Settings > Show Input Editor + /// + /// # The defaults of this file can be found at: + /// + /// # https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt + /// + /// # th [rest of string was truncated]";. + /// internal static string inputConf { get { return ResourceManager.GetString("inputConf", resourceCulture); } } + /// + /// Looks up a localized string similar to + /// # This file defines the input (keys and mouse) bindings of mpv and mpv.net + /// # and it also defines the context menu of mpv.net. mpv.net has an input + /// # editor and an config editor as alternatives to editing conf text files. + /// # The input and config editor can be found in mpv.net's context menu at: + /// + /// # Settings > Show Config Editor + /// # Settings > Show Input Editor + /// + /// # The defaults of this file can be found at: + /// + /// # https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt + /// + /// # t [rest of string was truncated]";. + /// internal static string inputConfHeader { get { return ResourceManager.GetString("inputConfHeader", resourceCulture); } } + /// + /// Looks up a localized string similar to + ///# mpv manual: https://mpv.io/manual/master/ + /// + ///# mpv.net mpv.conf defaults: https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/mpvConf.txt + /// + ///input-ar-delay = 500 + ///input-ar-rate = 20 + ///volume = 50 + ///hwdec = yes + ///keep-open = yes + ///keep-open-pause = no + ///osd-playing-msg = ${filename} + ///screenshot-directory = ~~desktop/ + ///input-default-bindings = no + ///. + /// internal static string mpvConf { get { return ResourceManager.GetString("mpvConf", resourceCulture); } } + /// + /// Looks up a localized string similar to [[settings]] + ///name = "hwdec" + ///default = "no" + ///filter = "Video" + ///helpurl = "https://mpv.io/manual/master/#options-hwdec" + ///help = "--hwdec=<mode> Specify the hardware video decoding API that should be used if possible. Whether hardware decoding is actually done depends on the video codec. If hardware decoding is not possible, mpv will fall back on software decoding.\n\nFor more information visit:" + ///options = [{ name = "no", help = "always use software decoding (Default)" }, + /// { name = "aut [rest of string was truncated]";. + /// internal static string mpvConfToml { get { return ResourceManager.GetString("mpvConfToml", resourceCulture); } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap mpvnet { + get { + object obj = ResourceManager.GetObject("mpvnet", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized string similar to [[settings]] + ///name = "dark-mode" + ///default = "always" + ///filter = "mpv.net" + ///help = "Enables a dark theme." + ///options = [{ name = "always" }, + /// { name = "system" , help = "Available on Windows 10 or higher" }, + /// { name = "never" }]. + /// internal static string mpvNetConfToml { get { return ResourceManager.GetString("mpvNetConfToml", resourceCulture); diff --git a/mpv.net/Properties/Resources.resx b/mpv.net/Properties/Resources.resx index c21778c..38a49a6 100644 --- a/mpv.net/Properties/Resources.resx +++ b/mpv.net/Properties/Resources.resx @@ -130,6 +130,9 @@ ..\Resources\mpvConfToml.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + ..\Resources\mpvnet.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\mpvNetConfToml.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 diff --git a/mpv.net/Resources/mpvnet.png b/mpv.net/Resources/mpvnet.png new file mode 100644 index 0000000000000000000000000000000000000000..8051abe69d7da290ed851808f279a5a051645ce4 GIT binary patch literal 6903 zcmXw8c|4R~)PH6M!(gmq-=!GRAd+?Ll4V3FOJhyh#!j{wd$JZaN|uVqHhzi_#+H&o zp|P(OvhTZh^uF&O^O-sK-19u=JLlf#e$V&0k1;i1hVj7w0ARjisCx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v.net/WinForms/MainForm.cs @@ -548,7 +548,13 @@ namespace mpvnet BuildMenu(); ContextMenuStrip = ContextMenu; IgnoreDpiChanged = false; - CheckURL(); + CheckURL(); + } + + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + if (mp.IsLogoVisible) mp.ShowLogo(); } protected override void OnFormClosed(FormClosedEventArgs e) diff --git a/mpv.net/mpv.net.csproj b/mpv.net/mpv.net.csproj index c7b06ec..8c42bb2 100644 --- a/mpv.net/mpv.net.csproj +++ b/mpv.net/mpv.net.csproj @@ -244,6 +244,7 @@ + diff --git a/mpv.net/mpv/mp.cs b/mpv.net/mpv/mp.cs index 96db6f2..d6c60a2 100644 --- a/mpv.net/mpv/mp.cs +++ b/mpv.net/mpv/mp.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Diagnostics; using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Reflection; @@ -53,6 +55,7 @@ namespace mpvnet public static IntPtr MpvHandle { get; set; } public static IntPtr MpvWindowHandle { get; set; } public static Addon Addon { get; set; } + public static bool IsLogoVisible { set; get; } public static List>> BoolPropChangeActions { get; set; } = new List>>(); public static List>> IntPropChangeActions { get; set; } = new List>>(); public static List>> StringPropChangeActions { get; set; } = new List>>(); @@ -157,6 +160,7 @@ namespace mpvnet set_property_string("force-window", "yes"); set_property_string("input-media-keys", "yes"); mpv_initialize(MpvHandle); + ShowLogo(); ProcessCommandLine(); Task.Run(() => { LoadScripts(); }); Task.Run(() => { Addon = new Addon(); }); @@ -226,11 +230,12 @@ namespace mpvnet break; case mpv_event_id.MPV_EVENT_END_FILE: var end_fileData = (mpv_event_end_file)Marshal.PtrToStructure(evt.data, typeof(mpv_event_end_file)); - EndFile?.Invoke((EndFileEventMode)end_fileData.reason); + EndFileEventMode reason = (EndFileEventMode)end_fileData.reason; + EndFile?.Invoke(reason); break; case mpv_event_id.MPV_EVENT_FILE_LOADED: + HideLogo(); FileLoaded?.Invoke(); - LoadFolder(); WriteHistory(mp.get_property_string("path")); break; case mpv_event_id.MPV_EVENT_TRACKS_CHANGED: @@ -241,6 +246,8 @@ namespace mpvnet break; case mpv_event_id.MPV_EVENT_IDLE: Idle?.Invoke(); + if (mp.get_property_int("playlist-count") == 0) + ShowLogo(); break; case mpv_event_id.MPV_EVENT_PAUSE: Pause?.Invoke(); @@ -343,6 +350,15 @@ namespace mpvnet } } + static void HideLogo() + { + if (IsLogoVisible) + { + mp.commandv("overlay-remove", "0"); + IsLogoVisible = false; + } + } + static List PythonEventObjects = new List(); public static void register_event(string name, IronPython.Runtime.PythonFunction pyFunc) @@ -518,12 +534,13 @@ namespace mpvnet protected static void ProcessCommandLine() { var args = Environment.GetCommandLineArgs().Skip(1); + List files = new List(); foreach (string i in args) if (!i.StartsWith("--") && File.Exists(i)) - mp.commandv("loadfile", i, "append"); + files.Add(i); - mp.set_property_string("playlist-pos", "0"); + mp.LoadFiles(files.ToArray()); foreach (string i in args) { @@ -543,6 +560,8 @@ namespace mpvnet public static void LoadFiles(params string[] files) { + if (files is null || files.Length == 0) return; + HideLogo(); int count = mp.get_property_int("playlist-count"); foreach (string file in files) @@ -553,18 +572,13 @@ namespace mpvnet for (int i = 0; i < count; i++) mp.commandv("playlist-remove", "0"); - mp.LoadFolder(); + mp.LoadFolder(files[0]); } - static bool WasFolderLoaded; - - static void LoadFolder() + static void LoadFolder(string path) { - if (WasFolderLoaded) return; - if (get_property_int("playlist-count") == 1) { - string path = get_property_string("path"); if (!File.Exists(path)) return; List files = Directory.GetFiles(Path.GetDirectoryName(path)).ToList(); files = files.Where((file) => App.VideoTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower()) || @@ -577,8 +591,6 @@ namespace mpvnet if (index > 0) commandv("playlist-move", "0", (index + 1).ToString()); } - - WasFolderLoaded = true; } static IntPtr AllocateUtf8IntPtrArrayWithSentinel(string[] arr, out IntPtr[] byteArrayPointers) @@ -642,6 +654,28 @@ namespace mpvnet LastHistoryStartDateTime = DateTime.Now; } + public static void ShowLogo() + { + if (MainForm.Instance is null) return; + Rectangle cr = MainForm.Instance.ClientRectangle; + + using (Bitmap b = new Bitmap(cr.Width, cr.Height)) + { + using (Graphics g = Graphics.FromImage(b)) + { + g.InterpolationMode = InterpolationMode.HighQualityBicubic; + g.Clear(Color.Black); + int iconWidth = cr.Height / 7; + Rectangle r = new Rectangle(cr.Width / 2 - iconWidth / 2, cr.Height / 2 - iconWidth / 2, iconWidth, iconWidth); + g.DrawImage(Properties.Resources.mpvnet, r); + BitmapData bd = b.LockBits(cr, ImageLockMode.ReadOnly, PixelFormat.Format32bppPArgb); + mp.commandv("overlay-add", "0", "0", "0", "&" + bd.Scan0.ToInt64().ToString(), "0", "bgra", bd.Width.ToString(), bd.Height.ToString(), bd.Stride.ToString()); + b.UnlockBits(bd); + IsLogoVisible = true; + } + } + } + static void ReadMetaData() { lock (MediaTracks)