Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
stax76 committed Apr 27, 2020
1 parent c67d5f1 commit 27d6026
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 8 additions & 2 deletions mpv.net/Misc/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,16 @@ public static void CycleAudio()
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");
}
Expand Down
2 changes: 1 addition & 1 deletion mpv.net/Misc/Help.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 0 additions & 4 deletions mpv.net/mpv/mp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class mp
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<string[]> ClientMessage; // client-message MPV_EVENT_CLIENT_MESSAGE
public static event Action VideoReconfig; // video-reconfig MPV_EVENT_VIDEO_RECONFIG
Expand Down Expand Up @@ -413,9 +412,6 @@ public static void EventLoop()
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;
Expand Down

0 comments on commit 27d6026

Please sign in to comment.