X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=share%2Flua%2FREADME.txt;h=1dd3609d95e69743226621701e9973009d4fa885;hb=538256248634dcc3ce44357a642d64a2cff1a477;hp=73dc2d54d858e369a87c3f1cd8c81033bceddcc6;hpb=91e56a1ea8059552d6de1b0497939c8b43eca6e4;p=vlc diff --git a/share/lua/README.txt b/share/lua/README.txt index 73dc2d54d8..1dd3609d95 100644 --- a/share/lua/README.txt +++ b/share/lua/README.txt @@ -55,8 +55,9 @@ local d = vlc.dialog( "My VLC Extension" ): Create a new UI dialog, with a human d:show(): Show this dialog. d:hide(): Hide (but not close) this dialog. d:delete(): Close and delete this dialog. -d:del_widget( widget ): Delete 'widget'. It disappears from the dialog and repositioning may occur. +d:set_title( title ): set the title of this dialog. d:update(): Update the dialog immediately (don't wait for the current function to return) +d:del_widget( widget ): Delete 'widget'. It disappears from the dialog and repositioning may occur. 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: @@ -162,14 +163,20 @@ misc.cachedir(): Get the user's VLC cache directory. misc.datadir_list( name ): FIXME: write description ... or ditch function if it isn't useful anymore, we have datadir and userdatadir :) -misc.mdate(): Get the current date (in milliseconds). -misc.mwait(): Wait for the given date (in milliseconds). +misc.action_id( name ): get the id of the given action. + +misc.mdate(): Get the current date (in microseconds). +misc.mwait(): Wait for the given date (in microseconds). misc.lock_and_wait(): Lock our object thread and wait for a wake up signal. misc.should_die(): Returns true if the interface should quit. misc.quit(): Quit VLC. +misc.timer(callback): Create a timer which call the callback function + :schedule(relative, value, interval): schedule the timer + :getoverrun(): number of time the timer got overrun (normally 0) + Net --- net.url_parse( url, [option delimiter] ): Parse URL. Returns a table with @@ -188,6 +195,7 @@ while true do net.close( fd ) end end +net.connect_tcp( host, port ): open a connection to the given host:port (TCP). net.close( fd ): Close file descriptor. net.send( fd, string, [length] ): Send data on fd. net.recv( fd, [max length] ): Receive data from fd. @@ -195,8 +203,8 @@ net.poll( { fd = events }, [timeout in seconds] ): Implement poll function. Returns the numbers of file descriptors with a non 0 revent. The function modifies the input table to { fd = revents }. See "man poll". net.POLLIN/POLLPRI/POLLOUT/POLLRDHUP/POLLERR/POLLHUP/POLLNVAL: poll event flags -net.fd_read( fd, [max length] ): Read data from fd. -net.fd_write( fd, string, [length] ): Write data to fd. +net.read( fd, [max length] ): Read data from fd. +net.write( fd, string, [length] ): Write data to fd. net.stat( path ): Stat a file. Returns a table with the following fields: .type .mode @@ -231,7 +239,10 @@ OSD osd.icon( type, [id] ): Display an icon on the given OSD channel. Uses the default channel is none is given. Icon types are: "pause", "play", "speaker" and "mute". -osd.message( string, [id] ): Display text message on the given OSD channel. +osd.message( string, [id], [position], [duration]: Display the text message on + the given OSD channel. Position types are: "center", "left", "right", "top", + "bottom", "top-left", "top-right", "bottom-left" or "bottom-right". The + duration is set in microseconds. osd.slider( position, type, [id] ): Display slider. Position is an integer from 0 to 100. Type can be "horizontal" or "vertical". osd.channel_register(): Register a new OSD channel. Returns the channel id. @@ -314,6 +325,13 @@ playlist.get( [what, [tree]] ): Get the playlist. .duration: (-1 if unknown) .nb_played: .children: A table of children playlist items. +playlist.search( name ): filter the playlist items with the given string +playlist.current(): return the current input item +playlist.sort( key ): sort the playlist according to the key. + Key must be one of the followings values: 'id', 'title', 'title nodes first', + 'artist', 'genre', 'random', 'duration', + 'title numeric' or 'album'. +playlist.status(): return the playlist status: 'stopped', 'playing', 'paused' or 'unknown'. FIXME: add methods to get an item's meta, options, es ... @@ -324,13 +342,14 @@ 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) +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.remove_item( item ): remove the item. n = vlc.sd.add_node( {title="Node"} ) n:add_subitem( ... ): Same as sd.add_item(), but as a subitem of n. @@ -365,9 +384,9 @@ strings.iconv( str1 to, str2 from, str ): use vlc_iconv to convert string Variables --------- var.get( object, name ): Get the object's variable "name"'s value. -var.set( object, name, value ): Set the object's variable "name" to "value". var.get_list( object, name ): Get the object's variable "name"'s value list. 1st return value is the value list, 2nd return value is the text list. +var.set( object, name, value ): Set the object's variable "name" to "value". var.create( object, name, value ): Create and set the object's variable "name" to "value". Created vars can be of type float, string or bool. @@ -404,9 +423,20 @@ a reference to it, all VLM items will be deleted. Volume ------ +volume.get(): Get volume. volume.set( level ): Set volume to an absolute level between 0 and 1024. 256 is 100%. -volume.get(): Get volume. volume.up( [n] ): Increment volume by n steps of 32. n defaults to 1. volume.down( [n] ): Decrement volume by n steps of 32. n defaults to 1. +XML +--- +xml = vlc.xml(): Create an xml object. +reader = xml:create_reader( stream ): create an xml reader that use the given stream. +reader:read(): read some data +reader:node_type(): return the type of the curret node: 'none', 'startelem', 'endelem' or 'text'. +reader:name(): name of the element +reader:value(): value of the element +reader:next_attr(): next attribute of the element + +The simplexml module can also be used to parse XML documents easily.