From c1cb0dd7eeb1c77bbc4c2270de54759b367ad741 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 26 Feb 2014 22:33:23 +0100 Subject: lua: add set_property_native function Probably completely useless, at least for now. Also not very well tested, but initial test seems successful. --- DOCS/man/en/lua.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'DOCS') diff --git a/DOCS/man/en/lua.rst b/DOCS/man/en/lua.rst index 338ffec6af..b520c36284 100644 --- a/DOCS/man/en/lua.rst +++ b/DOCS/man/en/lua.rst @@ -116,8 +116,6 @@ The ``mp`` module is preloaded, although it can be loaded manually with Returns a value on success, or ``def, error`` on error. Note that ``nil`` might be a possible, valid value too in some corner cases. - (There is no ``mp.set_property_native`` yet.) - ``mp.set_property(name, value)`` Set the given property to the given string value. See ``mp.get_property`` and `Properties`_ for more information about properties. @@ -137,6 +135,18 @@ The ``mp`` module is preloaded, although it can be loaded manually with represented as integer, and if so, it will pass an integer value to mpv, otherwise a double float. +``mp.set_property_native(name, value)`` + Similar to ``mp.set_property``, but set the given property using its native + type. + + Since there are several data types which can not represented natively in + Lua, this might not always work as expected. For example, while the Lua + wrapper can do some guesswork to decide whether a Lua table is an array + or a map, this would fail with empty tables. Also, there are not many + properties for which it makes sense to use this, instead of + ``set_property``, ``set_property_bool``, ``set_property_number``. + For these reasons, this function should probably be avoided for now. + ``mp.get_time()`` Return the current mpv internal time in seconds as a number. This is basically the system time, with an arbitrary offset. -- cgit v1.2.3