remove basic view and enhance advanced view of show-info command
This commit is contained in:
@@ -155,30 +155,17 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
static int LastShowInfo;
|
||||
|
||||
public static void ShowInfo()
|
||||
{
|
||||
if (Core.PlaylistPos == -1)
|
||||
return;
|
||||
|
||||
if (Environment.TickCount - LastShowInfo < 5000)
|
||||
{
|
||||
Core.Command("script-message-to mpvnet show-media-info osd");
|
||||
LastShowInfo = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
LastShowInfo = Environment.TickCount;
|
||||
|
||||
string text;
|
||||
long fileSize = 0;
|
||||
string path = Core.GetPropertyString("path");
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
fileSize = new FileInfo(path).Length;
|
||||
|
||||
if (CorePlayer.AudioTypes.Contains(path.Ext()))
|
||||
{
|
||||
text = Core.GetPropertyOsdString("filtered-metadata");
|
||||
@@ -187,6 +174,7 @@ namespace mpvnet
|
||||
}
|
||||
else if (CorePlayer.ImageTypes.Contains(path.Ext()))
|
||||
{
|
||||
fileSize = new FileInfo(path).Length;
|
||||
text = "Width: " + Core.GetPropertyInt("width") + "\n" +
|
||||
"Height: " + Core.GetPropertyInt("height") + "\n" +
|
||||
"Size: " + Convert.ToInt32(fileSize / 1024.0) + " KB\n" +
|
||||
@@ -195,6 +183,11 @@ namespace mpvnet
|
||||
Core.CommandV("show-text", text, "5000");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Core.Command("script-message-to mpvnet show-media-info osd");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (path.Contains("://")) path = Core.GetPropertyString("media-title");
|
||||
@@ -391,6 +384,7 @@ namespace mpvnet
|
||||
else
|
||||
{
|
||||
Core.UpdateExternalTracks();
|
||||
text = "N: " + Core.GetPropertyString("filename") + BR;
|
||||
lock (Core.MediaTracksLock)
|
||||
foreach (MediaTrack track in Core.MediaTracks)
|
||||
text += track.Text + BR;
|
||||
|
||||
Reference in New Issue
Block a user