From 9f6aba6cbdf6368bf4da7b69ec1b1257b5aa52e8 Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Tue, 18 Jun 2019 16:08:28 +0200 Subject: [PATCH] - --- mpv.net/WinForms/MainForm.cs | 3 +-- mpv.net/mpv/mp.cs | 28 ++++++++-------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/mpv.net/WinForms/MainForm.cs b/mpv.net/WinForms/MainForm.cs index 0e0f688..ea49666 100644 --- a/mpv.net/WinForms/MainForm.cs +++ b/mpv.net/WinForms/MainForm.cs @@ -353,8 +353,7 @@ namespace mpvnet Native.PostMessage(mp.WindowHandle, m.Msg, m.WParam, m.LParam); break; case 0x203: // Native.WM.LBUTTONDBLCLK - if (!IsMouseInOSC()) - mp.command_string("cycle fullscreen"); + if (!IsMouseInOSC()) mp.command_string("cycle fullscreen"); break; case 0x02E0: // WM_DPICHANGED if (IgnoreDpiChanged) break; diff --git a/mpv.net/mpv/mp.cs b/mpv.net/mpv/mp.cs index f9828ee..43a5911 100644 --- a/mpv.net/mpv/mp.cs +++ b/mpv.net/mpv/mp.cs @@ -564,32 +564,20 @@ namespace mpvnet { if (files is null || files.Length == 0) return; HideLogo(); - List fileList = files.ToList(); - foreach (string file in files) + for (int i = 0; i < files.Length; i++) { - string ext = Path.GetExtension(file).TrimStart('.').ToLower(); + string file = files[i]; - if (App.SubtitleTypes.Contains(ext)) - { + if (App.SubtitleTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower())) mp.commandv("sub-add", file); - fileList.Remove(file); - } + else + if (i == 0) + mp.commandv("loadfile", file); + else + mp.commandv("loadfile", file, "append"); } - if (fileList.Count == 0) return; - files = fileList.ToArray(); - - int count = mp.get_property_int("playlist-count"); - - foreach (string file in files) - mp.commandv("loadfile", file, "append"); - - mp.set_property_int("playlist-pos", count); - - for (int i = 0; i < count; i++) - mp.commandv("playlist-remove", "0"); - mp.LoadFolder(files[0]); }