[Alsaplayer-devel]python interface plugin

Evgeny Chukreev codedj@echo.ru
Sat, 13 Apr 2002 23:56:18 +0700


On Sat, 13 Apr 2002 13:44:59 +0200, Andy Lo A Foe <andy@alsaplayer.org> wrote:

ALAF> > It looks like alsaplayer doesn't see more than two options in such
ALAF> > context (#!)!
ALAF> > becouse if I type 'alsaplayer -v -v' in command line AP shows me version
ALAF> Of course alsaplayer chokes on this. One possible solution might be to
ALAF> pass the interface in the name. There is support for the following in
ALAF> alsaplayer currently:
ALAF> /usr/local/bin/alsaplayer = main alsaplayer binary
ALAF> # ln -s /usr/local/bin/alsaplayer /usr/local/bin/alsaplayer-python
ALAF> This will create a symlink /usr/local/bin/alsaplayer-python which points
ALAF> to the main binary. AlsaPlayer will detect this format and take the
ALAF> string after the - as the interface plugin to load so it will be like
ALAF> running "alsaplayer -i python". Replace python with any name of a valid
ALAF> interface plugin.
#!/usr/local/bin/alsaplayer-python

This won't work until you replace this lines by something, which will
consider optional path of command from argv[0].
if (sscanf(argv[0], "alsaplayer-%s", &use_interface) == 1 ||
    sscanf(argv[0], "jackplayer-%s", &use_interface) == 1) {
	/* Determine interface from the command line */
	printf("Using interface %s\n", use_interface);
}


-- 
... Evgeny ... [Nothing]