TKCD.COMMANDS

This document outlines the program friendly output of cdplayer when
it is run in tkcd mode. This mode is obtained by adding "tkcd" as the first
parameter on the command line.

The general output is semi-colon delimited ASCII text. The first item is the
command or ERROR. The next item is OK or a command specific parameter. A
newline marks the end of output.

By adding the command tkcd to the command line the output is changed as
follows:

PLAY;OK;track#  (where track number is the only thing there - eg. 10)
PLAY;ERROR
PAUSE;OK;track#
PAUSE;ERROR
PAUSE;NOPLAY		(CDROM not currently playing)
ERROR			(Low level error)
RESUME;OK;track#
RESUME;ERROR
RESUME;NOPAUSE		(CDROM not in paused state)
STATUS;CANT		(Audio status not supported)
STATUS;PLAY;track#;abs_time;rel_time;total_tracks;total_time
   where: track# - current track number
	Times are min*4500+sec*75+frame
        abs_time - current position on the CD
	rel_time - possible of CD relative last track (position into track)
	total_tracks - total tracks on CD
	total_time - total mins/sec on CD
   NOTE: 1 frame equals about 1/75 sec
STATUS;PAUSED;track#;abs_time;rel_time;total_tracks;total_time
STATUS;DONE		(CD is completed - most likely never returned...)
STATUS;ERROR		(CD stopped due to error)
STATUS;NONE		(No status - usually means CDROM is open or idle)
VOLUME;NOPLAY		(Can't change the volume unless the CDROM is playing
			...I really don't know if this is true or not as
			the Mitsumi driver for Linux does not support volume)
EJECT;ERROR
EJECT;OK
SKIP;NOPLAY		(CD not current playing)
SKIP;END		(At end of CD, can't skip to next track)
STOP;OK
STOP;NOPLAY		(Someone attempted to stop a stopped CD)
INFO;OK;max_track#,max_time;track#,track_time;track#,track_time...


Notes: 

1) If an incorrect volume number is passed to the player, it is gracefully 
ignored and no error is returned. Valid values are 0-255. This is done because I
am assuming the calling program only sends correct values. This is also the case
for the track number. If a bad track number is passed to the play command, it
is ignored.

2) On the last track if of the info command, the semi-colon is not present but is replaced by a newline to indicate the end of information.

3) All commands are terminated with a newline.

4) The skip command acknowledges the command's success by returning PLAY;OK;track#. This is the same output as the play command.
 
