ZoltanPlayer README

 ZoltanPlayer - Music playing daemon
 Copyright (C) 1991-2001 Angel Ortega <angel@triptico.com>
 Home Page: http://www.triptico.com/software/zoltan.html

This software is GPL. NO WARRANTY. See file 'COPYING' for details.

Intro

ZoltanPlayer is a music playing daemon. It accepts remote commands via its own mini HTTP server and can use seamlessly Audio or Data CDs. Audio CDs are played internally (optionally querying CDDB info servers) and digital songs in audio CDs are played via external players. It's not limited to CDs, as a hard disk directory can also be used.

ZoltanPlayer only runs on Linux by now.

Compilation

ZoltanPlayer depends of no libraries.

To compile ZoltanPlayer, just do

	 $ make

A binary called 'zoltan' will be generated.

There are some compilation time options to tweak, specially for some (arbitrary) limits. There are currently a limit of 16384 songs and 512 groups per media and 32 maximum external players, controlled by the MAX_SONGS, MAX_GROUPS and MAX_PLAYERS constants, respectively. If you happen to have more than that number of songs, just do

	 $ make CFLAGS=-DMAX_SONGS=100000

and the same for the others. The default config file is /etc/zoltan.conf; if you don't like it, you can change it by

	 $ make CFLAGS=-DDEFAULT_CONFIG_FILE=/opt/zoltan/zoltan.conf

or whatever you want (this can be changed in run-time, too).

Installation

As root, do

	 # make install

and the binary will be installed in /usr/local/sbin. If you want it in, say, /usr/sbin, change the prefix using

	 # make install PREFIX=/usr

you also must create a config file. Save zoltan.conf.sample as /etc/zoltan.conf and modify to suit your needs. Read the info there, specially about file and directory permissions.

Running it

Easy; just do

	 $ /usr/local/sbin/zoltan

and it will move to background automatically. You can specify an alternate config file as the first and only parameter. ZoltanPlayer is quite verbose; you would like to drop its standard and error output to the bit bucket /dev/null. It refuses to run as root, so choose a non-priviledged user.

By default, ZoltanPlayer accepts HTTP queries on port 5432 (unless you changed it in the configuration file). So point a web browser to it and you'll see an interactive (and spartan) web interface, where you can load CDs / unload CDs / play songs / change volume / etc.

Commands you can send to ZoltanPlayer

Here is a list of commands you can send to ZoltanPlayer:

mount  Mounts the CD in the drive (closing it if necessary). If it's a CD Audio, it will take info about it and search the local CDDB cache; if no info for this CD is found, it will query a remote CDDB server. If it's a CD-ROM, it will traverse it recursively looking for playable files and the subdirectories containing songs will be treated as groups. Anyway, the list of songs will be stored in its internal database ready for playing.
umount  Unmounts the CD, and ejects it.
xmount  A combination of the previous two. If CD is mounted, umount it, and vice-versa.
hd  Reads a directory from the hard disk (this directory must be defined in the config file to be used). It will be treated the same as a CD-ROM. This command can also be used to re-read the hard disk directory contents if it has been updated since ZoltanPlayer read it.
play  Starts playing the first song.
stop  Stops playing.
pause  Pauses / unpauses the currently playing song.
next-song  Moves to the next song and plays it.
prev-song  Move to the previous song and plays it.
goto-N  Moves to song number N and plays it.
next-group  Moves to the first song of the next group and plays it. If no group is defined (as in Audio CDs), it restarts playing from the first song.
prev-group  Moves to the first song of the previous group and plays it. If no group is defined (as in Audio CDs), it restarts playing from the first song.
song-info  Returns information about the song being played in one line. This command can be used from a shell script to display the info on an LCD, a ticker or something like that.
vol-up  Pumps up the volume by 5%. Only operative if the sound card mixer is being used.
vol-down  Lowers the volume by 5%. Only operative if the sound card mixer is being used.
cd-info  Shows the current list of songs, and information about the current group and song being played, if any.

All this commands (or any unrecognized one), except song-info and cd-info, returns an HTML page with clickable links.

You can send this commands (from, say, a dock customizable button application for window managers as WindowMaker of from an X10 remote control application) to a ZoltanPlayer server using lynx. For example, to mount a CD, you can type

	$ lynx -dump http://zoltanserver.example.com:5432/mount > /dev/null

the CD at zoltanserver will be closed and read, and any output from it ignored.

When will this damned MP3 song finish?

Knowing the duration of a digital song is a tricky business. An external 'sizer' program could be used to analyze each song, but if you use many formats (.mp3, .ogg, .wav, etc), obtaining such a program cannot be easy nor even possible. So, ZoltanPlayer doesn't do magic and acts just like you would do, that is, using a chronograph to time how much the song lasts. The song lengths are CRC'ed and cached in a file (/var/cache/zoltan.dat by default). ZoltanPlayer needs to write there, so be kind. You can also change the song cache path to whatever you want.

Misc Notes


Angel Ortega http://www.triptico.com