Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Hardware Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other

AmigaOS 4.0 - Other - PlayCD

PLAYCD acts as a user interface for the audio CD playback functionality offered by a CD-ROM drive. The CD-ROM drive in question must comply to the SCSI-2 standard and thus support at least a subset of the audio control commands defined for CD-ROM drives.

When the program is launched, it will attempt to configure itself. This involves figuring out which device driver and which device unit to use for audio playback. This information is usually stored in the program's icon, or it can also provided on the command line, both of which are detailed here.

The PlayCD User Interface
If properly configured, PlayCD will open a window as shown below:

which contains the following controls (left to right):

Track display
DIsplays information about the current audio track and the playback status. The first line displays the track information, the second line indicates how much time has passed with regard to length of the current track and the entire CD.

Track position (below the track display)
This slider displays the current track position. It can also be used to change the current track position, either by dragging the slider, clicking on the arrow keys at the right of the slider, or using the Shift+Cursor-left and Shift+Cursor-right keys.

Track selection
This is a set of 32 buttons, each one corresponding to one of the tracks of the audio CD. Click a button to make the corresponding audio track the current track. If playback is currently in progress, playback will proceed with the newly selected track. Alternatively, any two digit number entered will select that track, e.g. entering the two digits "1" and "2" in quick succession will pick track 12.

Volume
This is a vertical slider whose current setting corresponds to the sound playback volume. At the top position, playback volume is loudest. Alternatively, you can use the + and - keys.

 Eject - Press this button to eject/load the CD in the drive. For technical reasons, you may need to press this button more than once to load a CD. Alternatively, you can use either the "F1" or "Backspace" keys.

 Stop - Press this button to stop playback. Alternatively, you can use either the "F2" or "Cursor up" keys.

 Pause - Press this button to suspend/resume playback. Alternatively, you can use either the "F3" or "Space" keys.

 Previous track - Press this button to skip back to the beginning of the previous track. Alternatively, you can use either the "F4" or "Cursor-left" keys.

 Play - Press this button to begin playback. Alternatively, you can use either the "F5" or "Cursor-down" keys.

 Next track - Press this button to skip forward to the beginning of the next track. Alternatively, you can use either the "F6" or "Cursor-right" keys.

 Playback will normally step through the play list, playing each track once. Press this button to set up a play list which contains all CD tracks in random order. To return to the regular play list, press the "Stop" button. Alternatively, you can use the "F7" key to select this option.

 Pressing this button or using the "F8" key changes the playback mode; it can be one of the following:

  • Continue - This is the default playback mode. If you pick a track to play, it will be played along with all tracks to follow it until the last track on the CD is played. Clicking one of the track buttons in the track selection table will make the respective track the current track.
  • Program - In this mode every track number entered or clicked on will cause a new entry to be added to the play list. To play back the list, click the Play" button.
  • Track - In this mode playback will be restricted to the currently selected track. This means, for example, that if a track has been played to the end, playback will stop instead of proceeding to the next track.
Repeat
This switch controls whether playback will stop when the end of the play list has been reached or whether playback will restart with the first list entry. Alternatively, you can use the "F9" key.

Message list (below the Eject button)
This is where helpful progress reports and error messages are displayed. For example, if you picked a track by entering its number, you will see a notice confirming your input.

Stopping the program
Clicking on the Close gadget, or using one of the keyboard equivalents "Esc" or "Ctrl+\" while a track is playing will NOT stop the program. PLAYCD will close the window but will continue playing until the end of the designated play cycle. If you want to stop the program completely you must stop playback before attempting to close the program.

Understanding the CDDB
The CDDB can be used to identify CD and the tracks on those CD's. Most CD's will have an entry in the CDDB database which is accessible from http://www.freedb.org/freedb_search.php, where the information can be accessed either by title or by DiscID, but identifying the latter is far from being straightforward.

The DiscID is a 8-digit hexadecimal (base-16) number, computed using data from a CD's Table-of-Contents (TOC) in MSF (Minute Second Frame) form using a complex algorithm most of don't want to know about. It should be noted however that this algorithm is not perfect and frequently generates the same DiscID for multiple CD's, and in these situations the genre is often used to resolve it, but even that is not perfect, which means that there are times when you will need to go online and manually locate the CDDB information, but to do this you will need the DiscID.

The easiest way that we have found to get the DiscID is to start by running SnoopDOS, then to put the CD in the drive and start PlayCD. As part of its initialisation it will look in the local CDDB cache for a corresponding file, and the file name that it looks for is the DiscID, for example, 'F4111412' is the DiscID for Eric Clapton's 'The Cream of Clapton' CD, and the CDDB information can be retrieved from the online database using this DiscID. While titlle can also be used the number of entries sometimes returned is a bit like a Google search with hundreds to choose from.

If you have specified USECDDB and have an active Internet connection, PlayCD will automatically the online database (note, you may have to specify the URL <url> argument to point to a valid database). If a matching entry is found, this will be saved in the directory specified using the CACHEDIR <cache> argument or if this has not been specified, the default location of "SYS:Tools/CDDB-Cache". The file name will be the same as the DiscID.

If however, you cannot find the CD in the online database, or the CD is one you have created yourself, you can still create a CDDB entry for it but you will have to do it manually. Please note, you may have to turn on the 'Script' bit (via Information) before it will be acceptable to PLAYCD.

The following is the CDDB file for Eric Clapton's 'The Cream of Clapton' CD.

# xmcd
#
# Track frame offsets:
#     182
#     32485
#     44750
#     57835
#     76815
#     95797
#     108390
#     130997
#     153850
#     170022
#     189825
#     204152
#     219755
#     237155
#     256970
#     273557
#     295865
#     309382
# Disc length: 4374 seconds
# Revision: 22
# Processed by: cddbd v1.5.1PL0 Copyright (c) Steve Scherf et al.
#
# Submitted via: libkcddb 0.10
#
DISCID=f4111412
DTITLE=Eric CLAPTON / The Cream of Clapton
DYEAR=1994
DGENRE=Rock
TTITLE0=Layla
TTITLE1=Badge
TTITLE2=I Feel Free
TTITLE3=Sunshine of Your Love
TTITLE4=Crossroads
TTITLE5=Strange Brew
TTITLE6=White Room
TTITLE7=Bell Bottom Blues
TTITLE8=Cocaine
TTITLE9=I Shot the Sheriff
TTITLE10=After Midnight
TTITLE11=Swing Low Sweet Chariot
TTITLE12=Lay Down Sally
TTITLE13=Knockin' on Heavens Door
TTITLE14=Wonderful Tonight
TTITLE15=Let It Grow
TTITLE16=Promises
TTITLE17=I Can't Stand It
EXTD=YEAR: 1994 ID3G: 17
EXTT0=
EXTT1=
EXTT2=
EXTT3=
EXTT4=
EXTT5=
EXTT6=
EXTT7=
EXTT8=
EXTT9=
EXTT10=
EXTT11=
EXTT12=
EXTT13=
EXTT14=
EXTT15=
EXTT16=
EXTT17=
PLAYORDER=
Database entries must be in the US-ASCII, ISO-8859-1 (the 8-bit ASCII extension also known as "Latin alphabet #1" or ISO-Latin-1) or UTF-8 (Unicode) character set. Lines must always be terminated by a newline/linefeed (ctrl-J, or 0Ah) character or a carriage return character (ctrl-M, or 0Dh) followed by a newline/linefeed character. All lines in a database entry must be less than or equal to 256 characters in length, including the terminating character(s). Database entries with lines that are longer will be considered invalid. There must be no blank lines in a database entry.

Lines that begin with # are comments. Comments should appear only at the top of the file before any keywords. Comments in the body of the file are subject to removal when submitted for inclusion to the database. Comments should consist only of characters in the set:

{ tab (09h); space (20h) through tilde (7Eh) inclusive } Comments should be ignored by applications using the database file, with several exceptions described below.

The beginning of the first line in a database entry should consist of the string "# xmcd". This string identifies the file as an xmcd format CD database file. More text can appear after the "xmcd", but is unnecessary.

The comments should also contain the string "# Track frame offsets:" followed by the list of track offsets (the # of frames from the beginning of the CD) obtained from the table of contents on the CD itself, with any amount of white space between the "#" and the offset. There should be no other comments interspersed between the list of track offsets. This list must follow the initial identifier string described above. Following the offset list should be at least one blank comment, even though database entries without such a blank comment are also considered valid.

After the offset list, the following string should appear:

"# Disc length: N" where the number of seconds in the CD's play length is substituted for "N". The number of seconds should be computed by dividing the total number of 1/75th second frames in the CD by 75 and truncating any remainder. This number may not be rounded. Any string, such as "seconds", may be appended to the line provided there's at least one white space between the amount of seconds and the string. An application must be able to parse the line correctly at all times.

After the disc length, the following string should appear:

"# Revision: N" where the database entry revision (decimal integer) is substituted for "N". Files missing a revision are assumed to have a revision revision level of 0. The revision is used for database management when comparing two entries in order to determine which is the most recent. Client programs which allow the user to modify a database entry should increment the revision when the user submits a modified entry for inclusion in the database.

After the revision, the following string should appear:

"# Submitted via: client_name client_version optional_comments" where the name of the client submitting the entry is substituted for "client_name", the version of the client is substituted for "client_version", and "optional_comments" is any sequence of legal characters. Clients which allow users to modify database entries read from the database should update this string with their own information before submitting.

The "client_version" field has a very specific format which should be observed:

[leading text]version_number[release type][level]

where:

Leading text: is any string which does not include numbers.
Version number and level: is any (possibly) decimal-separated list of positive numbers.
Release type: is a string of the form: alpha, a, beta, b, patchlevel, patch, pl
for example: release:2.35.1
alpha7 v4.
0PL0 2.4
The only required portion of the version field is the version number. The other parts are optional, though it is strongly recommended that the release type field be filled in if relevant. Strict version checking may be applied by software which evaluates the submitter revision, so it is wise to make it clear when a release is beta, etc.

Following the comments is the disc data. Each line of disc data consists of the format "KEYWORD=data", where "KEYWORD" is a valid keyword as described below and "data" is any string consisting of characters in the set:

{ space (20h) through tilde (7Eh) inclusive; no-break-space (A0h) through y-umlaut (FFh) inclusive }

or an UTF-8 encoded string.

Newlines (0Ah), tabs (09h) and backslashes (2Fh) may be represented by the two-character sequences "\n", "\t" and "\\" respectively. Client programs must translate these sequences to the appropriate characters when displaying disc data.

All of the applicable keywords must be present in the file, though they may have empty data except for the DISCID and DTITLE keywords. They must appear in the file in the order shown below. Multiple occurrences of the same keyword indicate that the data contained on those lines should be concatenated; this applies to any of the textual fields. Keywords with numeric data should not have a comma after the last number on each line. Valid keywords are as follows:
DISCID: The data following this keyword should be a comma-separated list of 8-byte disc IDs. The disc ID indicated by the track offsets in the comment section must appear somewhere in the list. Other disc IDs represent links to this database entry. Note that linking entries is now deprecated and should not be used by submitting programs! The algorithm for generating the disc ID is described in the freedb.howto.
DTITLE: Technically, this may consist of any data, but by convention contains the artist and disc title (in that order) separated by a "/" with a single space on either side to separate it from the text. There may be other "/" characters in the DTITLE, but not with space on both sides, as that character sequence is exclusively reserved as delimiter of artist and disc title! If the "/" is absent, it is implied that the artist and disc title are the same, although in this case the name should rather be specified twice, separated by the delimiter. If the disc is a sampler containing titles of various artists, the disc artist should be set to "Various" (without the quotes).
DYEAR: This field contains the (4-digit) year, in which the CD was released. It should be empty (not 0) if the user hasn't entered a year.
DGENRE: This field contains the exact genre of the disc in a textual form (i.e. write the genre here and do not use e.g. simply the MP3 ID3V1 genre code). Please note that this genre is not limited to the 11 CDDB-genres. The Genre in this field should be capitalized, e.g. "New Age" instead of "newage" or "new age".
TTITLEN: There must be one of these for each track in the CD. The track number should be substituted for the "N", starting with 0. This field should contain the title of the Nth track on the CD. If the disc is a sampler and there are different artists for the track titles, the track artist and the track title (in that order) should be separated by a "/" with a single space on either side to separate it from the text.
EXTD: This field contains the "extended data" for the CD. This is intended to be used as a place for interesting information related to the CD, such as credits, et cetera. If there is more than one of these lines in the file, the data is concatenated. This allows for extended data of arbitrary length.
EXTTN: This field contains the "extended track data" for track "N". There must be one of these for each track in the CD. The track number should be substituted for the "N", starting with 0. This field is intended to be used as a place for interesting information related to the Nth track, such as the author and other credits, or lyrics. If there is more than one of these lines in the file, the data is concatenated. This allows for extended data of arbitrary length.
PLAYORDER: This field contains a comma-separated list of track numbers which represent a programmed track play order. This field is generally stripped of data in non-local database entries. Applications that submit entries for addition to the main database should strip any data from this keyword (i.e. add an empty "PLAYORDER=" line).


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.