				  cdplayer 0.2
			Copyright (c) 1997 Flavio Lerda
			
	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

        To contact the author:
                Flavio Lerda
                Via vittime di Bologna 14
                12026 Piasco CN
                Italy
        or:
                flerda@athena.polito.it
		
  0. Notice
			
  This program is a simple CD player that makes you able to play audio CD from
your computer CD drive.
  There are many CD player all around the world, but this is the one I prefer.
  I'm also developing special features that other CD player do not have.
  This is the second release that I publish so it's probably buggy and not
perfect, but please forgive me and send me a mail if you found a bug. I promise
I will try to correct the bug and send you a copy of the corrected program as
quickly as possible (and before the new release will be available!).
  
  1. Introduction
  
  This program was born to play audio CD and do its work.
  But it has some feature that can be useful:
    - a CD database that remember title of songs; 
    - a shuffle function that play song in random order;
    - a batch mode in which you have no used console.
    
  2. Installation
  
  For installation see the file INSTALL in this directory.
  
  3. Usage
  
  The program is quite easy to use. There are some forms you can use:
  
	cdplayer --help
		Show an help screen with the list of options.
		
	cdplayer --version
		Print the version of the program.
		
	cdplayer --license
		Display the license. This program is under GNU GPL.
		
	cdplayer [COMMAND] [OPTIONS] [DEVICE]
		Play the CD in the drive identified with DEVICE (or the
		default /dev/cdrom if DEVICE is not present). Then it
		execute the given command with the options you placed
		one the command line. For information about commands
		and options see followings sections.
		
  If one of the --license, --help, or --version switches is present on the
command line all the other switches are forgotten. If more than one of them is
present the one with higher priority is used (in order of descendent priority
they are --license, --help, and --version). So if --license and --version are
on the same command line only --license is meaningful.

  4. Commands

  To play you have to give a command to the cdplayer. There are different
commands. Only one command can be given on each command line. If no command is
given the NOTHING command is the default.

  The possible commands are PLAY, PLAY_CD, PLAY_TRACK, PLAY_PROGRAM, STOP,
NOTHING, PAUSE and RESUME. Each command is given with a switch on the command
line.
  The corrispondence between commands and switches is given by the following
table:

     command	     switch
  -------------	----------------
   PLAY		 --play, -p
   PLAY_CD	 --cd, -c
   PLAY_TRACK	 --track NN, -t NN
   PLAY_PROGRAM	 --program PP, -r PP
   STOP		 --stop, -s
   NOTHING	 default
   PAUSE	 --pause, -u
   RESUME	 --resume, -e

  4.1. PLAY command

  It plays the CD in interactive mode playing each track singly. It skips
tracks marked SKIP in the database. It supports SHUFFLE, REPEAT, DONTSKIP, and
EJECT options.

  4.2. PLAY_CD command

  It plays the CD as a whole. It doesn't skip tracks marked SKIP in the
database. It can run in batch mode. It supports REPEAT, EJECT, and QUIT
options.

  4.3 PLAY_TRACK command

  It plays a single track. It plays it if the track isn't marked SKIP in the
database. It can run in batch mode. It supports REPEAT, EJECT, DONTSKIP, and
QUIT options. This command requires an argument that is the number of the track
to play or a regular expression that matches the title of the song. If more
than one title matches the regular expression only one of them is played.  The
one played is the first track in the database that matches the regular
expression.

  4.4 PLAY_PROGRAM command

  It plays some tracks singly. It plays them if they aren't marked SKIP in the
database. It run in interactive mode. It supports SHUFFLE, REPEAT, EJECT, and
DONTSKIP options. This command requires an argument that is a comma separated
list of tracks. Each track can be the number of the track to play or a regular
expression that matches the title of the song. If more than one title matches
the regular expression all of them are played in the order given by their order
in the database.

  4.5 STOP command

  It stops the CD drive. It supports EJECT option only.

  4.6 NOTHING command

  It does nothing. It supports the EJECT, ID, LIST, and TRACE options. This
command is usefull for use with EJECT,ID, and LIST options because do not
change the state of the CD and it can be used when playing a CD.

  4.7 PAUSE command

  It pauses playing. It supports no options.

  4.8 RESUME command

  It resumes a previous paused playing. It supports no options.

  5. Options

  A command can be executed in different ways or modified giving it some
options. Not all options works with every command. For each options there is
a list of commands it can work with.

  The possible options are SHUFFLE, REPEAT, DONTSKIP, EJECT, ID, LIST, QUIT,
and TRACE. Each option is given with a switch on the command line.
  The corrispondence between options and switches is given by the following
table:

     option	     switch
  ------------	----------------
   SHUFFLE	 --shuffle, -S
   REPEAT	 --repeat, -R
   DONTSKIP	 --dontskip, -D
   EJECT	 --eject, -E
   ID		 --id, -I
   LIST		 --list, -L
   QUIT		 --quit, -Q
   TRACE	 --trace, -T

  5.1 SHUFFLE option

  It plays tracks in a random order. It can be used with PLAY and PLAY_PROGRAM
commands. Before playing the order of the tracks is changed.

  5.2 REPEAT option

  It repeats playing endless. Only with an interactive command you can stop the
playing. It can be used with PLAY, PLAY_CD, PLAY_TRACK, and PLAY_PROGRAM
commands. It can't be used with QUIT option.

  5.3 DONTSKIP option

  It plays also tracks that are marked SKIP in the database. It can be used
with PLAY, PLAY_TRACK, and PLAY_PROGRAM commands.

  5.4 EJECT option

  It ejects the CD before exiting. It can be used with PLAY, PLAY_CD,
PLAY_TRACK, PLAY_PROGRAM, STOP, and NOTHING commands. It can't be used with the
QUIT option.

  5.5 ID option

  It shows the ID of the CD in the drive. It can be used with NOTHING command
only.

  5.6 LIST option

  It lists the information in the database for the CD in the drive. It can be
used with NOTHING command only.

  5.7 QUIT option

  It quits the program after setting playing. It puts the program in batch
mode.  It can be used with PLAY_CD and PLAY_TRACK commands. It can't be used
with the EJECT or REPEAT options.

  5.8 TRACE option

  It shows the current state of the CD. It puts the program in interactive mode
without playing anything. Useful to control a playing started with QUIT option.
Can be used with NOTHING command only.

  6. The database
  
  The database is saved in the directory names ~/.cddb. The database is only
local to the user (at the moment). If different users use the same CD they
must have a copy of (or a link to) the file. A possibility to make an only
common database is to create a directory (for example /usr/local/cddb) with
read and write permission to everyone and make a link named .cddb for each
home that want to have the information in the database.

  In the database there is a file for each audio CD you have ever played with
the cdplayer. The name of the file is the ID of the media you can obtain from
the program. Each file contain some of lines that describe the CD.

  The first line contains the ID of the CD, that is the name of the file.
  The second line contains four fields:
  	the number of tracks;
	the title of the CD;
	the artist of the CD;
	the flags.
  The first and forth fields are number. The flags aren't used at the moment
and should be 0.
  The other fields are strings. They are characters between quotes.
  The fields are comma separated.
  Then there is a line for each tracks. Each line contains four fields:
  	the number of the track;
	the name of the track;
	a reserved field;
	the flags.
  The first and forth fields are number. The only used flag is the least
significant bit. If it's set, this track is marked SKIP.
  The other fields are strings. They are characters between quotes.
  The fields are comma separated.

  7. New features

  I'm studing to include new features. I list here some of them. If you're
interested in some of them and can't wait to see if I will implement it someday
fell free to mail me and ask for it. I will be more motivated to develop a
feature if I know there is someone else who like it and I could send you a
buggy beta to test for me with the feature you want.

  - a really interactive interface
  - a version for X
  - support for lyrics
  - a database editor
  - support for a shared system CD database
