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 - the [scripting wiki page](https://github.com/stax76/mpv.net/wiki/Scripting#powershell) was improved

View File

@@ -605,12 +605,15 @@ namespace mpvnet
set_property_string(left, right, true); set_property_string(left, right, true);
} }
else if (!preInit && !preInitProperties.Contains(left)) else if (!preInit && !preInitProperties.Contains(left))
{
if (!PrintCommandLineArgument(arg))
{ {
mp.ProcessProperty(left, right); mp.ProcessProperty(left, right);
if (!App.ProcessProperty(left, right)) if (!App.ProcessProperty(left, right))
set_property_string(left, right, true); set_property_string(left, right, true);
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
Msg.ShowException(e); Msg.ShowException(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 DateTime LastLoad;
public static void Load(string[] files, bool loadFolder, bool append) public static void Load(string[] files, bool loadFolder, bool append)