working on start-size option

This commit is contained in:
Frank Skare
2021-05-11 10:19:14 +02:00
parent 6f7f127279
commit b1388e10e5
11 changed files with 96 additions and 83 deletions

View File

@@ -18,7 +18,7 @@ namespace mpvnet
public static string DarkMode { get; set; } = "always";
public static string DarkTheme { get; set; } = "dark";
public static string LightTheme { get; set; } = "light";
public static string StartSize { get; set; } = "previous-height";
public static string StartSize { get; set; } = "height-session";
public static bool RememberPosition { get; set; }
public static bool DebugMode { get; set; }
@@ -96,7 +96,7 @@ namespace mpvnet
public static string Version {
get {
return "Copyright (C) 2017-2021 mpv.net/mpv/mplayer\n" +
return "Copyright (C) 2000-2021 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";
}

View File

@@ -54,7 +54,7 @@ namespace mpvnet
parameters.OutputAssembly = outputFile;
CompilerResults results = provider.CompileAssemblyFromFile(parameters, file);
var errors = results.Errors.Cast<CompilerError>().Select((i) => "Line Number " +
var errors = results.Errors.Cast<CompilerError>().Select(i => "Line Number " +
i.Line + "\r\n" + "Error Number: " + i.ErrorNumber + "\r\n" + i.ErrorText);
if (errors.Count() > 0)

View File

@@ -12,7 +12,6 @@ using VB = Microsoft.VisualBasic;
using static mpvnet.NewLine;
using static mpvnet.Core;
using System.Threading.Tasks;
namespace mpvnet
{
@@ -35,6 +34,7 @@ namespace mpvnet
case "playlist-first": PlaylistFirst(); break;
case "playlist-last": PlaylistLast(); break;
case "scale-window": ScaleWindow(float.Parse(args[0], CultureInfo.InvariantCulture)); break;
case "window-scale": WindowScale(float.Parse(args[0], CultureInfo.InvariantCulture)); break;
case "shell-execute": ProcessHelp.ShellExecute(args[0]); break;
case "show-about": ShowDialog(typeof(AboutWindow)); break;
case "show-audio-devices": ShowTextWithEditor("audio-device-list", core.get_property_osd_string("audio-device-list")); break;
@@ -350,10 +350,9 @@ namespace mpvnet
ProcessHelp.ShellExecute(file);
}
public static void ScaleWindow(float factor)
{
core.RaiseScaleWindow(factor);
}
public static void ScaleWindow(float factor) => core.RaiseScaleWindow(factor);
public static void WindowScale(float value) => core.RaiseWindowScale(value);
public static void ShowText(string text, int duration = 0, int fontSize = 0)
{

View File

@@ -137,16 +137,16 @@ namespace mpvnet
switch (type)
{
case "bool": case "boolean":
core.observe_property_bool(name, (value) => App.RunTask(() => PropertyChanged.Invoke(name, value)));
core.observe_property_bool(name, value => App.RunTask(() => PropertyChanged.Invoke(name, value)));
break;
case "string":
core.observe_property_string(name, (value) => App.RunTask(() => PropertyChanged.Invoke(name, value)));
core.observe_property_string(name, value => App.RunTask(() => PropertyChanged.Invoke(name, value)));
break;
case "int": case "integer":
core.observe_property_int(name, (value) => App.RunTask(() => PropertyChanged.Invoke(name, value)));
core.observe_property_int(name, value => App.RunTask(() => PropertyChanged.Invoke(name, value)));
break;
case "float": case "double":
core.observe_property_double(name, (value) => App.RunTask(() => PropertyChanged.Invoke(name, value)));
core.observe_property_double(name, value => App.RunTask(() => PropertyChanged.Invoke(name, value)));
break;
case "nil": case "none": case "native":
core.observe_property(name, () => App.RunTask(() => PropertyChanged.Invoke(name, null)));
@@ -168,11 +168,11 @@ namespace mpvnet
break;
case "end-file":
core.EndFileAsync += (reason) => Event.Invoke("end-file", new object[] { reason });
core.EndFileAsync += reason => Event.Invoke("end-file", new object[] { reason });
break;
case "client-message":
core.ClientMessageAsync += (args) => Event.Invoke("client-message", args);
core.ClientMessageAsync += args => Event.Invoke("client-message", args);
break;
case "shutdown":