From 09944583ddb5ac92cee53e0f3ee61817d2edf314 Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Sun, 26 Jul 2020 04:03:56 +0200 Subject: [PATCH] message asking if image is BD or DVD --- Changelog.md | 12 ++++++++---- mpv.net/Misc/Commands.cs | 4 ++-- mpv.net/Native/TaskDialog.cs | 6 ++++++ mpv.net/Properties/AssemblyInfo.cs | 4 ++-- mpv.net/mpv/Core.cs | 28 ++++++++++++++++++++++++---- 5 files changed, 42 insertions(+), 12 deletions(-) diff --git a/Changelog.md b/Changelog.md index d7c8d61..390ec18 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,12 +1,16 @@ -5.4.8.4 Beta (not yet released) +5.4.8.5 Beta (not yet released) ============ -- BluRays with dozens of titles showed all titles in the menu +5.4.8.4 Beta +============ + +- Blu-rays with dozens of titles showed all titles in the menu which was difficult to choose and extremely slow. -- BluRay folder paths are auto detected when received +- Blu-ray folder paths are auto detected when received from drag & drop and command line. -- Cycle audio was not working for BluRay. +- Cycle audio was not working for Blu-ray. +- Message asking if image is BD or DVD in case image is < 10 GB. 5.4.8.3 Beta diff --git a/mpv.net/Misc/Commands.cs b/mpv.net/Misc/Commands.cs index 264de4d..8ca2e7e 100644 --- a/mpv.net/Misc/Commands.cs +++ b/mpv.net/Misc/Commands.cs @@ -3,15 +3,15 @@ using System; using System.Diagnostics; using System.IO; using System.Linq; -using System.Windows; +using System.Threading; using System.Windows.Forms; using System.Windows.Interop; +using System.Windows; using VB = Microsoft.VisualBasic; using static NewLine; using static mpvnet.Core; -using System.Threading; namespace mpvnet { diff --git a/mpv.net/Native/TaskDialog.cs b/mpv.net/Native/TaskDialog.cs index e4983d1..fd377ce 100644 --- a/mpv.net/Native/TaskDialog.cs +++ b/mpv.net/Native/TaskDialog.cs @@ -363,6 +363,12 @@ public class TaskDialog : TaskDialogNative, IDisposable return value; } + public void AddCommand(string text) + { + object obj = text; + AddCommand(text, (T)obj); + } + public void AddCommand(string text, T value) { int n = 1000 + IdValueDic.Count + 1; diff --git a/mpv.net/Properties/AssemblyInfo.cs b/mpv.net/Properties/AssemblyInfo.cs index 987f615..eb37ddd 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.8.3")] -[assembly: AssemblyFileVersion("5.4.8.3")] +[assembly: AssemblyVersion("5.4.8.4")] +[assembly: AssemblyFileVersion("5.4.8.4")] diff --git a/mpv.net/mpv/Core.cs b/mpv.net/mpv/Core.cs index ec75423..5ef96fd 100644 --- a/mpv.net/mpv/Core.cs +++ b/mpv.net/mpv/Core.cs @@ -1043,17 +1043,37 @@ namespace mpvnet public void LoadISO(string path) { - core.command("stop"); - Thread.Sleep(500); long gb = new FileInfo(path).Length / 1024 / 1024 / 1024; if (gb < 10) { - core.set_property_string("dvd-device", path); - core.LoadFiles(new[] { @"dvd://" }, false, false); + using (TaskDialog td = new TaskDialog()) + { + td.MainInstruction = "Blu-ray or DVD?"; + td.AddCommand("Blu-ray"); + td.AddCommand("DVD"); + + switch (td.Show()) + { + case "Blu-ray": + core.command("stop"); + Thread.Sleep(500); + core.set_property_string("bluray-device", path); + core.LoadFiles(new[] { @"bd://" }, false, false); + break; + case "DVD": + core.command("stop"); + Thread.Sleep(500); + core.set_property_string("dvd-device", path); + core.LoadFiles(new[] { @"dvd://" }, false, false); + break; + } + } } else { + core.command("stop"); + Thread.Sleep(500); core.set_property_string("bluray-device", path); core.LoadFiles(new[] { @"bd://" }, false, false); }