Support of --version command

This commit is contained in:
Frank Skare
2021-02-16 10:03:35 +01:00
parent 6ba9b1f05a
commit 28c9b2710c
6 changed files with 39 additions and 31 deletions

View File

@@ -2,10 +2,11 @@
5.4.8.7 Beta (202?-??-??)
=========================
- history feature can be configured to ingore defined strings:
- History feature can be configured to ingore defined strings:
script-opt = history-discard=value1;value2
- Web stream audio and subtitle track selection.
- On Windows 10 the default code page was changed to UTF8.
- On Windows 10 1903 and later the default code page was changed to UTF8.
- Support of --version command.
5.4.8.6 Beta (2020-12-24)

View File

@@ -12,7 +12,7 @@ namespace mpvnet
{
public static class App
{
public static string[] VideoTypes { get; } = "264 265 asf avc avi avs dav flv h264 h265 hevc m2ts m2v m4v mkv mov mp4 mpeg mpg mpv mts ts vob vpy webm wmv y4m".Split(' ');
public static string[] VideoTypes { get; } = "264 265 asf avc avi avs dav flv h264 h265 hevc m2t m2ts m2v m4v mkv mov mp4 mpeg mpg mpv mts ts vob vpy webm wmv y4m".Split(' ');
public static string[] AudioTypes { get; } = "mp3 mp2 ac3 ogg opus flac wav w64 m4a dts dtsma dtshr dtshd eac3 thd thd+ac3 mka aac mpa".Split(' ');
public static string[] ImageTypes { get; } = { "jpg", "bmp", "gif", "png" };
public static string[] SubtitleTypes { get; } = { "srt", "ass", "idx", "sup", "ttxt", "ssa", "smi" };
@@ -99,6 +99,14 @@ namespace mpvnet
});
}
public static string Version {
get {
return "Copyright (C) 2000-2020 mpv.net/mpv/mplayer\n" +
$"mpv.net {Application.ProductVersion} ({File.GetLastWriteTime(Application.ExecutablePath).ToShortDateString()})\n" +
$"{core.get_property_string("mpv-version")} ({File.GetLastWriteTime(Folder.Startup + "mpv-1.dll").ToShortDateString()})\nffmpeg {core.get_property_string("ffmpeg-version")}\nMIT License";
}
}
public static void ShowException(object obj)
{
if (obj is Exception e)

View File

@@ -1,6 +1,5 @@

using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;

View File

@@ -5,7 +5,6 @@ using System.Linq;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Threading;
using System.Threading.Tasks;
using static mpvnet.Core;
using static NewLine;

View File

@@ -1,10 +1,7 @@

using System.IO;
using System.Windows;
using System.Windows.Input;
using static mpvnet.Core;
namespace mpvnet
{
public partial class AboutWindow : Window
@@ -12,9 +9,7 @@ namespace mpvnet
public AboutWindow()
{
InitializeComponent();
ContentBlock.Text= "Copyright (C) 2017-2020 Frank Skare (stax76)\n" +
$"mpv.net {System.Windows.Forms.Application.ProductVersion} ({File.GetLastWriteTime(System.Windows.Forms.Application.ExecutablePath).ToShortDateString()})\n" +
$"{core.get_property_string("mpv-version")} ({File.GetLastWriteTime(Folder.Startup + "mpv-1.dll").ToShortDateString()})\nffmpeg {core.get_property_string("ffmpeg-version")}\nMIT License";
ContentBlock.Text = App.Version;
}
protected override void OnPreviewKeyDown(KeyEventArgs e) => Close();

View File

@@ -1,7 +1,6 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
@@ -9,7 +8,6 @@ using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static libmpv;
@@ -956,25 +954,33 @@ namespace mpvnet
{
try
{
if (arg == "--profile=help")
if (!preInit)
{
ConsoleHelp.Write(mpvHelp.GetProfiles(), null);
continue;
}
else if (arg == "--vd=help" || arg == "--ad=help")
{
ConsoleHelp.Write(mpvHelp.GetDecoders(), null);
continue;
}
else if (arg == "--audio-device=help")
{
ConsoleHelp.Write(core.get_property_osd_string("audio-device-list"), null);
continue;
}
else if (arg == "--input-keylist")
{
ConsoleHelp.Write(core.get_property_string("input-key-list").Replace(",", BR), null);
continue;
if (arg == "--profile=help")
{
Console.WriteLine(mpvHelp.GetProfiles());
continue;
}
else if (arg == "--vd=help" || arg == "--ad=help")
{
Console.WriteLine(mpvHelp.GetDecoders());
continue;
}
else if (arg == "--audio-device=help")
{
Console.WriteLine(core.get_property_osd_string("audio-device-list"));
continue;
}
else if (arg == "--version")
{
Console.WriteLine(App.Version);
continue;
}
else if (arg == "--input-keylist")
{
Console.WriteLine(core.get_property_string("input-key-list").Replace(",", BR));
continue;
}
}
if (!arg.StartsWith("--"))