From c2c33228a0fefa3f2f91d757a7d23e66357a2303 Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Fri, 6 Sep 2019 04:32:39 +0200 Subject: [PATCH] a issue with the taskbar-progress feature was fixed --- Changelog.md | 8 ++++++++ mpv.net/Properties/AssemblyInfo.cs | 4 ++-- mpv.net/WinForms/MainForm.cs | 11 ++++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Changelog.md b/Changelog.md index 8b4264f..ed53528 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,11 @@ +### + +- a issue with the taskbar-progress feature was fixed + +### 5.4.1 + +- fix ArgumentOutOfRangeException + ### 5.4 - added taskbar-progress implementation diff --git a/mpv.net/Properties/AssemblyInfo.cs b/mpv.net/Properties/AssemblyInfo.cs index 3f03797..b72cdc2 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.0.0")] -[assembly: AssemblyFileVersion("5.4.0.0")] +[assembly: AssemblyVersion("5.4.1.0")] +[assembly: AssemblyFileVersion("5.4.1.0")] diff --git a/mpv.net/WinForms/MainForm.cs b/mpv.net/WinForms/MainForm.cs index b4ecc39..90cf4be 100644 --- a/mpv.net/WinForms/MainForm.cs +++ b/mpv.net/WinForms/MainForm.cs @@ -387,9 +387,10 @@ namespace mpvnet else Text = "mpv.net " + Application.ProductVersion; - ProgressTimer.Interval = (int)(mp.Duration.TotalMilliseconds / 99); - if (ProgressTimer.Interval < 100) ProgressTimer.Interval = 100; - if (ProgressTimer.Interval > 999) ProgressTimer.Interval = 999; + int interval = (int)(mp.Duration.TotalMilliseconds / 100); + if (interval < 100) interval = 100; + if (interval > 1000) interval = 1000; + ProgressTimer.Interval = interval; UpdateProgressBar(); })); @@ -486,7 +487,7 @@ namespace mpvnet return; } - if (m.Msg == TaskbarButtonCreatedMessage) + if (m.Msg == TaskbarButtonCreatedMessage && mp.TaskbarProgress) { Taskbar = new Taskbar(Handle); ProgressTimer.Start(); @@ -543,7 +544,7 @@ namespace mpvnet void PropChangePause(bool enabled) { - if (Taskbar != null) + if (Taskbar != null && mp.TaskbarProgress) { if (enabled) Taskbar.SetState(TaskbarStates.Paused);