[vlc-devel] vlc: svn commit r22946 (dionoea)

Subversion daemon svn at videolan.org
Sun Nov 4 22:42:27 CET 2007


r22946 | dionoea | 2007-11-04 22:42:27 +0100 (Sun, 04 Nov 2007) | 45 lines
Changed paths:
   M /trunk/Makefile.am
   M /trunk/modules/misc/lua/Modules.am
   A /trunk/modules/misc/lua/callbacks.c
   A /trunk/modules/misc/lua/configuration.c
   A /trunk/modules/misc/lua/intf.c (from /trunk/modules/misc/lua/vlclua.c:22766)
   D /trunk/modules/misc/lua/luameta.c
   D /trunk/modules/misc/lua/luaplaylist.c
   A /trunk/modules/misc/lua/meta.c (from /trunk/modules/misc/lua/luameta.c:22766)
   A /trunk/modules/misc/lua/net.c
   A /trunk/modules/misc/lua/objects.c
   A /trunk/modules/misc/lua/playlist.c (from /trunk/modules/misc/lua/luaplaylist.c:22766)
   A /trunk/modules/misc/lua/variables.c
   A /trunk/modules/misc/lua/vlc.c (from /trunk/modules/misc/lua/vlclua.c:22766)
   A /trunk/modules/misc/lua/vlc.h (from /trunk/modules/misc/lua/vlclua.h:22766)
   D /trunk/modules/misc/lua/vlclua.c
   D /trunk/modules/misc/lua/vlclua.h
   A /trunk/modules/misc/lua/vlm.c
   M /trunk/share/Makefile.am
   A /trunk/share/luaintf
   A /trunk/share/luaintf/dummy.lua
   A /trunk/share/luaintf/hotkeys.lua
   A /trunk/share/luaintf/modules
   A /trunk/share/luaintf/modules/common.lua
   A /trunk/share/luaintf/modules/host.lua
   A /trunk/share/luaintf/rc.lua
   A /trunk/share/luaintf/telnet.lua

Add a new type of VLC Lua module: Interfaces.
Two things led me to add this new type of Lua modules:
 * Most interfaces duplicate code from one another (rc and telnet both deal
   with sockets, rc and hotkeys duplicate VLC interfacing code)
 * It's easier to code in Lua than in C (for high level stuff)
(* Users can code their own module easily, all they need is a text editor.)

Most of the changes in modules/misc/ are Lua wrappers for different C APIs
in VLC. I'd say that 90% of those wrappers won't change, the other 10% might
 need small changes (mostly to simplify the C code).

The VLC Lua "interface" module will look for lua scripts in the
*share*/luaintf/ directory. Files in *share*/luaintf/modules/ are lua modules
which can be used by multiple VLC Lua modules (using require "modulename").

This commit includes 4 Lua interface modules:
 * dummy.lua: the default module. Prints error messages and quits.
 * rc.lua: equivalent to the legacy rc.c module. Also includes a bunch of
   new features (+ multiple socket connections at a time work!). See file for
   more details.
 * telnet.lua: equivalent to the legacy telnet.c module. See file for more
   details.
 * hotkeys.lua: a rewrite of the hotkey handling module. This module is still
   experimental. I'll need to change VLC core hotkeys stuff to make it work
   like I want (ie: 1 hotkey triggers 1 action instead of the current 1 action
   can have 1 hotkey). This version executes 3 dummy actions when keys 'q',
   'w' or 'x' are pressed.

What's left to do:
 * Port the http interface plugin to this framework (at least for the
   macros/rpn part ... using <?vlc some lua code ?> à la PHP would be way
   easier than what we currently have).
 * Finish work on the hotkeys module.
 * Code a real telnet/rc module with autocompletion and all the cool features
   usually found in a telnet/terminal interface.
 * Trash the legacy C modules.

Stuff to test (which I can't test myself):
 * Win32 and Mac OS X specific changes to Makefile.am
 * Console interface under Win32. I expect it not to work.

Other stuff included in this changeset are:
 * Code cleanup (I'm sure that it's still possible to simplify some of the old lua bindings code).
 * That's pretty much it in fact :/

 > http://trac.videolan.org/vlc/changeset/22946



More information about the vlc-devel mailing list