misc
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
    
|
    
|
||||||
|
|
||||||
?? mpv.net
|
🎞 mpv.net
|
||||||
==========
|
==========
|
||||||
|
|
||||||
mpv.net is a modern media player for Windows based on the popular [mpv](https://mpv.io) player.
|
mpv.net is a modern media player for Windows based on the popular [mpv](https://mpv.io) player.
|
||||||
|
|||||||
@@ -286,10 +286,16 @@ namespace mpvnet
|
|||||||
using (MediaInfo mi = new MediaInfo(path))
|
using (MediaInfo mi = new MediaInfo(path))
|
||||||
{
|
{
|
||||||
MediaTrack[] audTracks = mp.MediaTracks.Where(track => track.Type == "a").ToArray();
|
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");
|
int aid = mp.get_property_int("aid");
|
||||||
aid += 1;
|
aid += 1;
|
||||||
if (aid > audTracks.Length) aid = 1;
|
|
||||||
|
if (aid > audTracks.Length)
|
||||||
|
aid = 1;
|
||||||
|
|
||||||
mp.commandv("set", "aid", aid.ToString());
|
mp.commandv("set", "aid", aid.ToString());
|
||||||
mp.commandv("show-text", audTracks[aid - 1].Text.Substring(3), "5000");
|
mp.commandv("show-text", audTracks[aid - 1].Text.Substring(3), "5000");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 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);
|
Write(obj, module, ConsoleColor.Black, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ namespace mpvnet
|
|||||||
public static event Action Idle; // idle MPV_EVENT_IDLE
|
public static event Action Idle; // idle MPV_EVENT_IDLE
|
||||||
public static event Action Pause; // MPV_EVENT_PAUSE
|
public static event Action Pause; // MPV_EVENT_PAUSE
|
||||||
public static event Action Unpause; // MPV_EVENT_UNPAUSE
|
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 ScriptInputDispatch; // MPV_EVENT_SCRIPT_INPUT_DISPATCH
|
||||||
public static event Action<string[]> ClientMessage; // client-message MPV_EVENT_CLIENT_MESSAGE
|
public static event Action<string[]> ClientMessage; // client-message MPV_EVENT_CLIENT_MESSAGE
|
||||||
public static event Action VideoReconfig; // video-reconfig MPV_EVENT_VIDEO_RECONFIG
|
public static event Action VideoReconfig; // video-reconfig MPV_EVENT_VIDEO_RECONFIG
|
||||||
@@ -413,9 +412,6 @@ namespace mpvnet
|
|||||||
case mpv_event_id.MPV_EVENT_UNPAUSE:
|
case mpv_event_id.MPV_EVENT_UNPAUSE:
|
||||||
Unpause?.Invoke();
|
Unpause?.Invoke();
|
||||||
break;
|
break;
|
||||||
case mpv_event_id.MPV_EVENT_TICK:
|
|
||||||
Tick?.Invoke();
|
|
||||||
break;
|
|
||||||
case mpv_event_id.MPV_EVENT_SCRIPT_INPUT_DISPATCH:
|
case mpv_event_id.MPV_EVENT_SCRIPT_INPUT_DISPATCH:
|
||||||
ScriptInputDispatch?.Invoke();
|
ScriptInputDispatch?.Invoke();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user