From 27d6026213de23a428744bf08b451f07f62522b7 Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Mon, 27 Apr 2020 15:41:16 +0200 Subject: [PATCH] misc --- README.md | 2 +- mpv.net/Misc/Command.cs | 10 ++++++++-- mpv.net/Misc/Help.cs | 2 +- mpv.net/mpv/mp.cs | 4 ---- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ed836c5..d96321c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/stax76/mpv.net) ![GitHub closed issues](https://img.shields.io/github/issues-closed/stax76/mpv.net) ![GitHub All Releases](https://img.shields.io/github/downloads/stax76/mpv.net/total) ![GitHub tag (latest by date)](https://img.shields.io/github/tag-date/stax76/mpv.net) ![GitHub stars](https://img.shields.io/github/stars/stax76/mpv.net) -?? mpv.net +🎞 mpv.net ========== mpv.net is a modern media player for Windows based on the popular [mpv](https://mpv.io) player. diff --git a/mpv.net/Misc/Command.cs b/mpv.net/Misc/Command.cs index 9159828..b14768f 100644 --- a/mpv.net/Misc/Command.cs +++ b/mpv.net/Misc/Command.cs @@ -286,10 +286,16 @@ namespace mpvnet using (MediaInfo mi = new MediaInfo(path)) { MediaTrack[] audTracks = mp.MediaTracks.Where(track => track.Type == "a").ToArray(); - if (audTracks.Length < 2) return; + + if (audTracks.Length < 2) + return; + int aid = mp.get_property_int("aid"); aid += 1; - if (aid > audTracks.Length) aid = 1; + + if (aid > audTracks.Length) + aid = 1; + mp.commandv("set", "aid", aid.ToString()); mp.commandv("show-text", audTracks[aid - 1].Text.Substring(3), "5000"); } diff --git a/mpv.net/Misc/Help.cs b/mpv.net/Misc/Help.cs index 05e8eab..f89fd80 100644 --- a/mpv.net/Misc/Help.cs +++ b/mpv.net/Misc/Help.cs @@ -8,7 +8,7 @@ public static class ConsoleHelp public static void WriteError(object obj, string module = null) => Write(obj, module, ConsoleColor.Red, false); - public static void Write(object obj, string module) + public static void Write(object obj, string module = "mpv.net") { Write(obj, module, ConsoleColor.Black, true); } diff --git a/mpv.net/mpv/mp.cs b/mpv.net/mpv/mp.cs index 6e0eb54..c62b44f 100644 --- a/mpv.net/mpv/mp.cs +++ b/mpv.net/mpv/mp.cs @@ -44,7 +44,6 @@ namespace mpvnet public static event Action Idle; // idle MPV_EVENT_IDLE public static event Action Pause; // MPV_EVENT_PAUSE public static event Action Unpause; // MPV_EVENT_UNPAUSE - public static event Action Tick; // tick MPV_EVENT_TICK public static event Action ScriptInputDispatch; // MPV_EVENT_SCRIPT_INPUT_DISPATCH public static event Action ClientMessage; // client-message MPV_EVENT_CLIENT_MESSAGE public static event Action VideoReconfig; // video-reconfig MPV_EVENT_VIDEO_RECONFIG @@ -413,9 +412,6 @@ namespace mpvnet case mpv_event_id.MPV_EVENT_UNPAUSE: Unpause?.Invoke(); break; - case mpv_event_id.MPV_EVENT_TICK: - Tick?.Invoke(); - break; case mpv_event_id.MPV_EVENT_SCRIPT_INPUT_DISPATCH: ScriptInputDispatch?.Invoke(); break;