X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=share%2Flua%2FREADME.txt;h=aebf0b15b08d25bfc5bc2d79e3142f7c69450b4b;hb=83655cec3fe316a3f073c510688b881f10c787c1;hp=9d86c72ecfb87081cc9292505dc4fed14142ca3e;hpb=90583f82bc7355314476a03b8e8760aad4efb897;p=vlc diff --git a/share/lua/README.txt b/share/lua/README.txt index 9d86c72ecf..aebf0b15b0 100644 --- a/share/lua/README.txt +++ b/share/lua/README.txt @@ -17,6 +17,7 @@ All the Lua standard libraries are available. * Art fetcher (see meta/README.txt) * Interface (see intf/README.txt) * Extensions (see extensions/README.txt) + * Services Discovery (see sd/README.txt) Lua scripts are tried in alphabetical order in the user's VLC config directory lua/{playlist,meta,intf}/ subdirectory on Windows and Mac OS X or @@ -62,7 +63,7 @@ They define the position of a widget in the dialog: - 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. 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 or

for instance). d:add_text_input( text, ... ): Create an editable text field, in order to read user input. @@ -129,6 +130,14 @@ input.item(): Get the current input item. Input item methods are: .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). @@ -313,10 +322,24 @@ sd.get_services_names(): Get a table of all available service discovery sd.add( name ): Add service discovery. sd.remove( name ): Remove service discovery. sd.is_loaded( name ): Check if service discovery is loaded. +sd.add_item( ... ): Add an item to the service discovery. + The item object has the same members as the one in playlist.add(). + Returns the input item. +sd.add_node( ... ): Add a node to the service discovery. + The node object has the following members: + .title: the node's name + .arturl: the node's ArtURL (OPTIONAL) + +n = vlc.sd.add_node( {title="Node"} ) +n:add_subitem( ... ): Same as sd.add_item(), but as a subitem of n. +n:add_node( ... ): Same as sd.add_node(), but as a subnode of n. 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?).