From 27f7935127866ec01b7350dfaa7e2dd635510e3c Mon Sep 17 00:00:00 2001 From: stax76 Date: Sat, 21 May 2022 10:58:39 +0200 Subject: [PATCH] misc --- README.md | 1 + docs/Changelog.md | 1 + docs/Manual.md | 2 +- src/Misc/CSharpScriptHost.cs | 2 +- src/Misc/Commands.cs | 4 +++- src/Misc/MainForm.cs | 2 +- src/Misc/Player.cs | 4 ++-- 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ccd6d93..76307a5 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ Features that mpv and mpv.net have in common -------------------------------------------- - Lua and JavaScript Scripting +- Hundreds available user scripts make mpv the most feature rich desktop video player - Simple config files that are easy to read and edit - JSON IPC to control the player with a external programs - On Screen Controler (OSC, play control buttons) with modern flat design diff --git a/docs/Changelog.md b/docs/Changelog.md index 563194b..5b4efe9 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,4 +1,5 @@ +- Progress command shows time and date. - New show-santa-logo (green and grumpy) option. - New quick bookmark feature, see manual. - Fix crash choosing Matroska edition in the menu. diff --git a/docs/Manual.md b/docs/Manual.md index 885a821..acbd11d 100644 --- a/docs/Manual.md +++ b/docs/Manual.md @@ -348,7 +348,7 @@ and allows to play the selected entry. Shows available profiles with a message box. ### show-progress -Shows a simple OSD progress message. +Shows a simple OSD progress message with time and date. ### show-properties Shows available properties in the command palette and diff --git a/src/Misc/CSharpScriptHost.cs b/src/Misc/CSharpScriptHost.cs index 89b1000..f9a6a7a 100644 --- a/src/Misc/CSharpScriptHost.cs +++ b/src/Misc/CSharpScriptHost.cs @@ -25,7 +25,7 @@ namespace mpvnet static void Execute(string file) { string code = File.ReadAllText(file); - string filename = Path.GetFileNameWithoutExtension(file) + " " + StringHelp.GetMD5Hash(code) + "-v5.dll"; + string filename = Path.GetFileNameWithoutExtension(file) + " " + StringHelp.GetMD5Hash(code) + "-v6.dll"; string outputFile = Path.Combine(Path.GetTempPath(), filename); if (!File.Exists(outputFile)) diff --git a/src/Misc/Commands.cs b/src/Misc/Commands.cs index 50beed3..520bfc0 100644 --- a/src/Misc/Commands.cs +++ b/src/Misc/Commands.cs @@ -678,7 +678,9 @@ namespace mpvnet if (App.QuickBookmark == 0) { App.QuickBookmark = (float)Core.GetPropertyDouble("time-pos"); - Core.Command("show-text 'Bookmark Saved'"); + + if (App.QuickBookmark != 0) + Core.Command("show-text 'Bookmark Saved'"); } else { diff --git a/src/Misc/MainForm.cs b/src/Misc/MainForm.cs index 3eb6ed4..98ecce6 100644 --- a/src/Misc/MainForm.cs +++ b/src/Misc/MainForm.cs @@ -954,7 +954,7 @@ namespace mpvnet void UpdateProgressBar() { if (Core.TaskbarProgress && Taskbar != null) - Taskbar.SetValue(Core.GetPropertyDouble("time-pos"), Core.Duration.TotalSeconds); + Taskbar.SetValue(Core.GetPropertyDouble("time-pos", false), Core.Duration.TotalSeconds); } void PropChangeOnTop(bool value) => BeginInvoke(new Action(() => TopMost = value)); diff --git a/src/Misc/Player.cs b/src/Misc/Player.cs index ee9fdc6..a66ab64 100644 --- a/src/Misc/Player.cs +++ b/src/Misc/Player.cs @@ -802,11 +802,11 @@ namespace mpvnet return lpBuffer.ToInt64(); } - public double GetPropertyDouble(string name) + public double GetPropertyDouble(string name, bool handleError = true) { mpv_error err = mpv_get_property(Handle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_DOUBLE, out double value); - if (err < 0 && (App.DebugMode || App.DebuggerAttached)) + if (err < 0 && handleError && (App.DebugMode || App.DebuggerAttached)) HandleError(err, $"error getting property: {name}"); return value; }