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:
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
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.
-net.poll( { fd = events }, [timeout in seconds] ): Implement poll function.
+net.poll( { fd = events } ): 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
object.playlist(): Get the playlist object.
object.libvlc(): Get the libvlc object.
-object.find( object, type, mode ): Find an object of given type. mode can
- be any of "parent", "child" and "anywhere". If set to "parent", it will
- look in "object"'s parent objects. If set to "child" it will look in
- "object"'s children. If set to "anywhere", it will look in all the
- objects. If object is unset, the current module's object will be used.
- Type can be: "libvlc", "playlist", "input", "decoder",
- "vout", "aout", "packetizer", "generic".
- This function is deprecated and slow and should be avoided.
-object.find_name( object, name, mode ): Same as above except that it matches
- on the object's name and not type. This function is also slow and should
- be avoided if possible.
+object.find( object, type, mode ): Return nil. DO NOT USE.
OSD
---
example: .options = { "fullscreen" }
.duration: stream duration in seconds (OPTIONAL)
.meta: custom meta data (OPTIONAL, meta data)
- A .meta field is a table of custom meta categories which
- each have custom meta properties.
- example: .meta = { ["Google video"] = { ["docid"] = "-5784010886294950089"; ["GVP version"] = "1.1" }; ["misc"] = { "Hello" = "World!" } }
+ A .meta field is a table of custom meta key value pairs.
+ example: .meta = { ["GVP docid"] = "-5784010886294950089", ["GVP version] = "1.1", Hello = "World!" }
Invalid playlist items will be discarded by VLC.
playlist.enqueue( ... ): like playlist.add() except that track isn't played.
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 ...
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.
function returns as many variables as it had arguments.
strings.encode_uri_component( [uri1, [uri2, [...]]] ): Encode a list of URI
components. This function returns as many variables as it had arguments.
+strings.make_uri( path, [scheme] ): Convert a file path to a URI.
strings.resolve_xml_special_chars( [str1, [str2, [...]]] ): Resolve XML
special characters in a list of strings. This function returns as many
variables as it had arguments.
strings.convert_xml_special_chars( [str1, [str2, [...]]] ): Do the inverse
operation.
-strings.iconv( str1 to, str2 from, str ): use vlc_iconv to convert string
- from encoding to another
+strings.from_charset( charset, str ): convert a string from a specified
+ character encoding into UTF-8.
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.
+ to "value". Created vars can be of type float, string, bool or void.
+ For a void variable the value has to be 'nil'.
var.add_callback( object, name, function, data ): Add a callback to the
object's "name" variable. Callback functions take 4 arguments: the
var.libvlc_command( name, argument ): Issue libvlc's "name" command with
argument "argument".
+var.inc_integer( name ): Increment the given integer.
+var.dec_integer( name ): Decrement the given integer.
+var.count_choices( name ): Return the number of choices.
+var.toggle_bool( name ): Toggle the given boolean.
+
Video
-----
video.fullscreen( [status] ):
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, return -1 on error, 0 on EOF, 1 on start of XML
+ element, 2 on end of XML element, 3 on 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.