1 - About Lua
=============
-Lua documenation is available on http://www.lua.org . The reference manual
+Lua documention is available on http://www.lua.org . The reference manual
is very usefull: http://www.lua.org/manual/5.1/ .
VLC uses Lua 5.1
All the Lua standard libraries are available.
2 - Lua in VLC
==============
-3 types of VLC Lua scripts can currently be coded:
+Several types of VLC Lua scripts can currently be coded:
* Playlist (see playlist/README.txt)
* Art fetcher (see meta/README.txt)
* Interface (see intf/README.txt)
local d = vlc.dialog( "My VLC Extension" ): Create a new UI dialog, with a human-readble title: "My VLC Extension"
d:show(): Show this dialog.
d:hide(): Hide (but not close) this dialog.
-d:close(): Close and delete this dialog.
+d:delete(): Close and delete this dialog.
d:del_widget( widget ): Delete 'widget'. It disappears from the dialog and repositionning may occur.
+d:update(): Update the dialog immediately (don't wait for the current function to return)
-In the following functions, you can always add some optional parameters: col, row, col_span, row_span.
+In the following functions, you can always add some optional parameters: col, row, col_span, row_span, width, height.
They define the position of a widget in the dialog:
- row, col are the absolute positions on a grid of widgets. First row, col are 1.
- row_span, col_span represent the relative size of a widget on the grid. A widget with col_span = 4 will be displayed as wide as 4 widgets of col_span = 1.
+- width and height are size hints (in pixels) but may be discarded by the GUI module
Example: w = d:add_label( "My Label", 2, 3, 4, 5 ) will create a label at row 3, col 2, with a relative width of 4, height of 5.
-d:add_button( text, func, ... ): Create a button with caption "text" (string). When clicked, call function "func". func is a string.
+d:add_button( text, func, ... ): Create a button with caption "text" (string). When clicked, call function "func". func is a function reference.
d:add_label( text, ... ): Create a text label with caption "text" (string).
d:add_html( text, ... ): Create a rich text label with caption "text" (string), that supports basic HTML formatting (such as <i> or <h1> for instance).
d:add_text_input( text, ... ): Create an editable text field, in order to read user input.
.played_abuffers
.lost_abuffers
+MD5
+---
+md5( str ): return the string's hash
+md5(): create an md5 object with the following methods:
+ :add( str ): add a string to the hash
+ :end_(): finish hashing
+ :hash(): return the hash
+
Messages
--------
msg.dbg( [str1, [str2, [...]]] ): Output debug messages (-vv).
Stream
------
stream( url ): Instantiate a stream object for specific url.
+memory_stream( string ): Instantiate a stream object containing a specific string.
+ Those two functions return the stream object upon success and nil if an
+ error occured, in that case, the second return value will be an error message.
s = vlc.stream( "http://www.videolan.org/" )
s:read( 128 ) -- read up to 128 characters. Return 0 if no more data is available (FIXME?).