diff options
author | wm4 <wm4@nowhere> | 2014-02-26 22:33:23 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-26 22:38:34 +0100 |
commit | c1cb0dd7eeb1c77bbc4c2270de54759b367ad741 (patch) | |
tree | 7bc4a03eaee193b78855e3656257e1540e9efb06 /DOCS | |
parent | 15134935602a546103a26f4b3ecc72da25896f09 (diff) | |
download | mpv-c1cb0dd7eeb1c77bbc4c2270de54759b367ad741.tar.bz2 mpv-c1cb0dd7eeb1c77bbc4c2270de54759b367ad741.tar.xz |
lua: add set_property_native function
Probably completely useless, at least for now.
Also not very well tested, but initial test seems successful.
Diffstat (limited to 'DOCS')
-rw-r--r-- | DOCS/man/en/lua.rst | 14 |
1 files changed, 12 insertions, 2 deletions
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. |