
			Xmcd CD Database File Format
			         Version 1.0

			       By Steve Scherf

	      Based on the xmcd database file design by Ti Kan
	      ------------------------------------------------

Revision: $Id: DBFORMAT,v 1.7 1996/12/20 09:26:41 steve Exp $


Database entries must be in the ISO-8859-1 character set (the 8-bit ASCII
extension also known as "Latin alphabet #1"). Lines must always be
terminated only by a single newline (ctrl-J, or 0Ah). All lines in a
database entry must be less than or equal to 80 bytes in length, including
the newline. 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
may 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 in MSF format as they appear in the table
of contents on the CD itself. Each offset should appear on a comment line by
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.

After the offset list, the following string should appear:

"# Disc length: N seconds"

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
should not be rounded. 

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. This field is
used for database maintenance and is useful for correlating database problems
with specific clients. It is not required, though it is highly recommended
that clients generate this field when submitting entries. Clients which allow
users to modify database entries read from the database should update this
field with their own information before submitting.

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 }

Newlines (20h), 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.
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. The algorithm for generating
	the disc ID is beyond the scope of this document.

DTITLE: Technically, this may consist of any data, but by convention contains
	the artist and disc title (in that order) separated by a "/". If the
	"/" is absent, it is implied that the artist and disc title are the
	same.

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.

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 this
	keyword of data.


A minimal database entry is as follows. A "[ ... ]" indicates repetition.

# xmcd
#
# Track frame offsets:
#	150
[ ... 21 frame offsets omitted ]
#	210627
#
# Disc length: 2952 seconds
#
# Revision: 1
# Submitted via: xmcd 2.0
#
DISCID=270b8617,5f430c17,[ ... ],4c72be17
[ ... ]
DISCID=88fe2017,ff293017,[ ... ],5920cc17
DTITLE=Con Spirito / Franske stemninger
TTITLE0=Mille regretz de vous abandonner
[ ... 21 TTITLEN keywords omitted ]
TTITLE22=L'arche de no
EXTD=Copyright (c) 1981 MCA Records Inc.\nManufactured
EXTD=for MCA Records Inc.
EXTT0=Des Prez\nYez
[ ... 21 EXTTN keywords omitted ]
EXTT22=Schmitt: A contre-voix \n(excerpt)
PLAYORDER=1,5,6,19,7,[ ... ],19
PLAYORDER=8,20,[ ... ],21
