Info command shows the length
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
and various other things are documented in the manual.
|
||||
- The action used for the right mouse button can be configured.
|
||||
- Workaround not reproducible logo drawing crash.
|
||||
- Info command shows the length.
|
||||
- MediaInfo 22.03
|
||||
|
||||
|
||||
|
||||
@@ -173,9 +173,6 @@ namespace mpvnet
|
||||
if (path.Contains("://"))
|
||||
path = Core.GetPropertyString("media-title");
|
||||
|
||||
int width = Core.GetPropertyInt("video-params/w");
|
||||
int height = Core.GetPropertyInt("video-params/h");
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
fileSize = new FileInfo(path).Length;
|
||||
@@ -223,12 +220,13 @@ namespace mpvnet
|
||||
|
||||
string videoFormat = Core.GetPropertyString("video-format").ToUpper();
|
||||
string audioCodec = Core.GetPropertyString("audio-codec-name").ToUpper();
|
||||
|
||||
text = path.FileName() + $"\n{width} x {height}\n";
|
||||
|
||||
if (fileSize > 0)
|
||||
text += Convert.ToInt32(fileSize / 1024.0 / 1024.0) + " MB\n";
|
||||
|
||||
int width = Core.GetPropertyInt("video-params/w");
|
||||
int height = Core.GetPropertyInt("video-params/h");
|
||||
TimeSpan len = TimeSpan.FromSeconds(Core.GetPropertyDouble("duration"));
|
||||
text = path.FileName() + "\n";
|
||||
text += FormatTime(len.TotalMinutes) + ":" + FormatTime(len.Seconds) + "\n";
|
||||
if (fileSize > 0) text += Convert.ToInt32(fileSize / 1024.0 / 1024.0) + " MB\n";
|
||||
text += $"{width} x {height}\n";
|
||||
text += $"{videoFormat}\n{audioCodec}";
|
||||
|
||||
Core.CommandV("show-text", text, "5000");
|
||||
@@ -239,6 +237,8 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
static string FormatTime(double value) => ((int)value).ToString("00");
|
||||
|
||||
public static void ShowProgress()
|
||||
{
|
||||
TimeSpan position = TimeSpan.FromSeconds(Core.GetPropertyDouble("time-pos"));
|
||||
@@ -250,8 +250,6 @@ namespace mpvnet
|
||||
FormatTime(duration.Seconds);
|
||||
|
||||
Core.CommandV("show-text", text, "5000");
|
||||
|
||||
string FormatTime(double value) => ((int)value).ToString("00");
|
||||
}
|
||||
|
||||
public static void OpenFromClipboard() => App.InvokeOnMainThread(() =>
|
||||
|
||||
Reference in New Issue
Block a user