support added for --list-properties

This commit is contained in:
Frank Skare
2019-09-20 04:45:24 +02:00
parent 21188f0942
commit 4562131078
2 changed files with 22 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
TODO: fix volume/mute being initialized muted
###
- the [scripting wiki page](https://github.com/stax76/mpv.net/wiki/Scripting#powershell) was improved

View File

@@ -606,9 +606,12 @@ namespace mpvnet
}
else if (!preInit && !preInitProperties.Contains(left))
{
mp.ProcessProperty(left, right);
if (!App.ProcessProperty(left, right))
set_property_string(left, right, true);
if (!PrintCommandLineArgument(arg))
{
mp.ProcessProperty(left, right);
if (!App.ProcessProperty(left, right))
set_property_string(left, right, true);
}
}
}
catch (Exception e)
@@ -642,6 +645,20 @@ namespace mpvnet
}
}
static bool PrintCommandLineArgument(string argument)
{
switch (argument)
{
case "--list-properties=yes":
var list = get_property_string("property-list").Split(',').ToList();
list.Sort();
Console.WriteLine(string.Join("\r\n", list.ToArray()));
return true;
}
return false;
}
public static DateTime LastLoad;
public static void Load(string[] files, bool loadFolder, bool append)