shorter media info to better fit on screen
This commit is contained in:
@@ -426,39 +426,35 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
|
|
||||||
string path = Core.GetPropertyString("path");
|
string path = Core.GetPropertyString("path");
|
||||||
|
string text = "";
|
||||||
|
|
||||||
if (File.Exists(path) && !path.Contains(@"\\.\pipe\"))
|
bool full = args.Contains("full");
|
||||||
|
bool raw = args.Contains("raw");
|
||||||
|
bool editor = args.Contains("editor");
|
||||||
|
bool osd = args.Contains("osd");
|
||||||
|
|
||||||
|
if (App.MediaInfo && !osd && File.Exists(path) && !path.Contains(@"\\.\pipe\"))
|
||||||
|
using (MediaInfo mediaInfo = new MediaInfo(path))
|
||||||
|
text = Regex.Replace(mediaInfo.GetSummary(full, raw), "Unique ID.+", "");
|
||||||
|
else
|
||||||
{
|
{
|
||||||
string text = "";
|
Core.UpdateExternalTracks();
|
||||||
|
lock (Core.MediaTracksLock)
|
||||||
|
foreach (MediaTrack track in Core.MediaTracks)
|
||||||
|
text += track.Text + BR;
|
||||||
|
}
|
||||||
|
|
||||||
bool full = args.Contains("full");
|
text = text.TrimEx();
|
||||||
bool raw = args.Contains("raw");
|
|
||||||
bool editor = args.Contains("editor");
|
|
||||||
bool osd = args.Contains("osd");
|
|
||||||
|
|
||||||
if (App.MediaInfo && !osd)
|
if (editor)
|
||||||
using (MediaInfo mediaInfo = new MediaInfo(path))
|
ShowTextWithEditor("media-info", text);
|
||||||
text = Regex.Replace(mediaInfo.GetSummary(full, raw), "Unique ID.+", "");
|
else if (osd)
|
||||||
else
|
ShowText(text.Replace("\r", ""), 5000, 17);
|
||||||
{
|
else
|
||||||
Core.UpdateExternalTracks();
|
{
|
||||||
lock (Core.MediaTracksLock)
|
MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Consolas");
|
||||||
foreach (MediaTrack track in Core.MediaTracks)
|
Msg.ShowInfo(text);
|
||||||
text += track.Text + BR;
|
MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Segoe UI");
|
||||||
}
|
|
||||||
|
|
||||||
text = text.TrimEx();
|
|
||||||
|
|
||||||
if (editor)
|
|
||||||
ShowTextWithEditor("media-info", text);
|
|
||||||
else if (osd)
|
|
||||||
ShowText(text.Replace("\r", ""), 5000, 15);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Consolas");
|
|
||||||
Msg.ShowInfo(text);
|
|
||||||
MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Segoe UI");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1480,8 +1480,13 @@ namespace mpvnet
|
|||||||
|
|
||||||
if (type == "video")
|
if (type == "video")
|
||||||
{
|
{
|
||||||
|
string codec = GetPropertyString($"track-list/{i}/codec").ToUpperEx();
|
||||||
|
if (codec == "MPEG2VIDEO")
|
||||||
|
codec = "MPEG2";
|
||||||
|
else if (codec == "DVVIDEO")
|
||||||
|
codec = "DV";
|
||||||
MediaTrack track = new MediaTrack();
|
MediaTrack track = new MediaTrack();
|
||||||
Add(track, GetPropertyString($"track-list/{i}/codec").ToUpperEx());
|
Add(track, codec);
|
||||||
Add(track, GetPropertyString($"track-list/{i}/demux-w") + "x" + GetPropertyString($"track-list/{i}/demux-h"));
|
Add(track, GetPropertyString($"track-list/{i}/demux-w") + "x" + GetPropertyString($"track-list/{i}/demux-h"));
|
||||||
Add(track, GetPropertyString($"track-list/{i}/demux-fps").Replace(".000000", "") + " FPS");
|
Add(track, GetPropertyString($"track-list/{i}/demux-fps").Replace(".000000", "") + " FPS");
|
||||||
Add(track, GetPropertyBool($"track-list/{i}/default") ? "Default" : null);
|
Add(track, GetPropertyBool($"track-list/{i}/default") ? "Default" : null);
|
||||||
@@ -1492,10 +1497,13 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
else if (type == "audio")
|
else if (type == "audio")
|
||||||
{
|
{
|
||||||
|
string codec = GetPropertyString($"track-list/{i}/codec").ToUpperEx();
|
||||||
|
if (codec.Contains("PCM"))
|
||||||
|
codec = "PCM";
|
||||||
MediaTrack track = new MediaTrack();
|
MediaTrack track = new MediaTrack();
|
||||||
Add(track, GetLanguage(GetPropertyString($"track-list/{i}/lang")));
|
Add(track, GetLanguage(GetPropertyString($"track-list/{i}/lang")));
|
||||||
Add(track, GetPropertyString($"track-list/{i}/codec").ToUpperEx());
|
Add(track, codec);
|
||||||
Add(track, GetPropertyInt($"track-list/{i}/audio-channels") + " channels");
|
Add(track, GetPropertyInt($"track-list/{i}/audio-channels") + " ch");
|
||||||
Add(track, GetPropertyInt($"track-list/{i}/demux-samplerate") / 1000 + " kHz");
|
Add(track, GetPropertyInt($"track-list/{i}/demux-samplerate") / 1000 + " kHz");
|
||||||
Add(track, GetPropertyBool($"track-list/{i}/forced") ? "Forced" : null);
|
Add(track, GetPropertyBool($"track-list/{i}/forced") ? "Forced" : null);
|
||||||
Add(track, GetPropertyBool($"track-list/{i}/default") ? "Default" : null);
|
Add(track, GetPropertyBool($"track-list/{i}/default") ? "Default" : null);
|
||||||
@@ -1509,12 +1517,16 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
else if (type == "sub")
|
else if (type == "sub")
|
||||||
{
|
{
|
||||||
string codec = GetPropertyString($"track-list/{i}/codec");
|
string codec = GetPropertyString($"track-list/{i}/codec").ToUpperEx();
|
||||||
if (codec.Contains("pgs"))
|
if (codec.Contains("PGS"))
|
||||||
codec = "pgs";
|
codec = "PGS";
|
||||||
|
else if (codec == "DVB_SUBTITLE")
|
||||||
|
codec = "DVB";
|
||||||
|
else if (codec == "DVD_SUBTITLE")
|
||||||
|
codec = "VOB";
|
||||||
MediaTrack track = new MediaTrack();
|
MediaTrack track = new MediaTrack();
|
||||||
Add(track, GetLanguage(GetPropertyString($"track-list/{i}/lang")));
|
Add(track, GetLanguage(GetPropertyString($"track-list/{i}/lang")));
|
||||||
Add(track, codec.ToUpperEx());
|
Add(track, codec);
|
||||||
Add(track, GetPropertyBool($"track-list/{i}/forced") ? "Forced" : null);
|
Add(track, GetPropertyBool($"track-list/{i}/forced") ? "Forced" : null);
|
||||||
Add(track, GetPropertyBool($"track-list/{i}/default") ? "Default" : null);
|
Add(track, GetPropertyBool($"track-list/{i}/default") ? "Default" : null);
|
||||||
Add(track, GetPropertyBool($"track-list/{i}/external") ? "External" : null);
|
Add(track, GetPropertyBool($"track-list/{i}/external") ? "External" : null);
|
||||||
@@ -1524,7 +1536,6 @@ namespace mpvnet
|
|||||||
track.ID = GetPropertyInt($"track-list/{i}/id");
|
track.ID = GetPropertyInt($"track-list/{i}/id");
|
||||||
track.External = external;
|
track.External = external;
|
||||||
tracks.Add(track);
|
tracks.Add(track);
|
||||||
Debug.WriteLine(GetPropertyString($"track-list/{i}/codec"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1558,11 +1569,16 @@ namespace mpvnet
|
|||||||
|
|
||||||
for (int i = 0; i < videoCount; i++)
|
for (int i = 0; i < videoCount; i++)
|
||||||
{
|
{
|
||||||
|
string fps = mi.GetVideo(i, "FrameRate");
|
||||||
|
|
||||||
|
if (float.TryParse(fps, NumberStyles.Float, CultureInfo.InvariantCulture, out float result))
|
||||||
|
fps = result.ToString(CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
MediaTrack track = new MediaTrack();
|
MediaTrack track = new MediaTrack();
|
||||||
Add(track, mi.GetVideo(i, "Format"));
|
Add(track, mi.GetVideo(i, "Format"));
|
||||||
Add(track, mi.GetVideo(i, "Format_Profile"));
|
Add(track, mi.GetVideo(i, "Format_Profile"));
|
||||||
Add(track, mi.GetVideo(i, "Width") + "x" + mi.GetVideo(i, "Height"));
|
Add(track, mi.GetVideo(i, "Width") + "x" + mi.GetVideo(i, "Height"));
|
||||||
Add(track, mi.GetVideo(i, "FrameRate") + " FPS");
|
Add(track, fps + " FPS");
|
||||||
Add(track, mi.GetVideo(i, "Language/String"));
|
Add(track, mi.GetVideo(i, "Language/String"));
|
||||||
Add(track, mi.GetVideo(i, "Forced") == "Yes" ? "Forced" : "");
|
Add(track, mi.GetVideo(i, "Forced") == "Yes" ? "Forced" : "");
|
||||||
Add(track, mi.GetVideo(i, "Default") == "Yes" ? "Default" : "");
|
Add(track, mi.GetVideo(i, "Default") == "Yes" ? "Default" : "");
|
||||||
@@ -1582,7 +1598,7 @@ namespace mpvnet
|
|||||||
Add(track, mi.GetAudio(i, "Format"));
|
Add(track, mi.GetAudio(i, "Format"));
|
||||||
Add(track, mi.GetAudio(i, "Format_Profile"));
|
Add(track, mi.GetAudio(i, "Format_Profile"));
|
||||||
Add(track, mi.GetAudio(i, "BitRate/String"));
|
Add(track, mi.GetAudio(i, "BitRate/String"));
|
||||||
Add(track, mi.GetAudio(i, "Channel(s)/String"));
|
Add(track, mi.GetAudio(i, "Channel(s)") + " ch");
|
||||||
Add(track, mi.GetAudio(i, "SamplingRate/String"));
|
Add(track, mi.GetAudio(i, "SamplingRate/String"));
|
||||||
Add(track, mi.GetAudio(i, "Forced") == "Yes" ? "Forced" : "");
|
Add(track, mi.GetAudio(i, "Forced") == "Yes" ? "Forced" : "");
|
||||||
Add(track, mi.GetAudio(i, "Default") == "Yes" ? "Default" : "");
|
Add(track, mi.GetAudio(i, "Default") == "Yes" ? "Default" : "");
|
||||||
|
|||||||
Reference in New Issue
Block a user