[vlc-devel] Re: [RFC] Module specific commands in the RC interface

Jean-Paul Saman jean-paul.saman at planet.nl
Sun Mar 25 14:12:18 CEST 2007

Antoine Cellerier wrote:
> Having to edit the RC interface when ever we want to add a module
> specific command is kind of burdensome. If a module could register
> variables as commands, the RC interface code wouldn't need to be edited.
> It is already possible to register a variable in VLC as a command (using
> the VLC_VAR_ISCOMMAND flag when creating the variable). This is already
> used by core commands 'list', 'tree' and 'vars' defined in
> src/misc/objects.c for p_libvlc_global. Those work in the RC interface
> because it checks if commands it receives are registered on the p_intf
> and p_intf->pèlibvlc_global objects.
> To make it possible to execute commands registered by other objects, we
> need a way to specify which object we're targetting (We could also loop
> through all the objects until we find one which qualifies ... but that
> sounds like a bad idea). As some of you might have noticed, I commited
> code this afternoon which makes it possible to name an object. For
> example, if you use 'vlc --sub-filter marq at somename', the marq instance
> will be named 'somename'. I suggest that we use this name to identify
> the commands' destination object.
> The syntax in the RC interface would thus be:
> @objectname command [args]
> (All core related commands would still be issued using the old syntax.)
> This would break compatibility with older version (I already broke it
> this afternoon ...) but fix two fundamental errors in the previous way
> the marq, time, logo and mosaic commands were handled:
> 1/ Those objects should not use p_libvlc_global to store their
> variables. (This makes it impossible to have more than one instance.)
> 2/ The RC interface code shouldn't need to be changed to add new
> commands.
> I already have code on my computer to make it work that way (which adds
> support for 'adjust' filter commands). I'd like to know what you think
> about this new syntax and commands handling before commiting it.
Sounds like a good idea as long as it doesn't obfuscate the commands 
meanings. It would improve consistency and maintainability of the rc 
module. However be carefull it doesn't destroy its usability by using 
too cryptic (ambiguous) names.

Jean-Paul Saman.

This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html

More information about the vlc-devel mailing list