ADC Home > Reference Library > Technical Notes > Legacy Documents > Apple Applications >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

CD Remote Database Format

CONTENTS

This Technote describes the format of the "CD Remote Programs" database, as used in the "CD Remote" desk accessory, the Hypercard CD Audio XCMDs, etc.

[Oct 01 1997]






Introduction

The file "CD Remote Programs" is used by the CD Remote desk accessory, AppleCD Audio Player, and other applications to retain information about an audio CD. This file contains some master data in an `IndX' resource. For each CD that has been entered into the database, a resource of type `ProG' and a resource of type `STR#' are kept. There is only one `IndX' resource, number 128, in the "CD Remote Programs" file. There is a `ProG' and `STR#' resource for each CD which has been entered into the database. The number of the `ProG' and `STR#' resource are the same number for each CD. This number is generated by a call to Unique1ID.

Back to top

'IndX' Resource Format

The initial two bytes of the 'IndX' resource are a version number. The next two bytes are the number of CDs in the database. The `IndX' resource contains a six byte entry for each CD. The first byte is the number of tracks on the CD. The next three bytes are the playing length of the CD in minutes, seconds, and blocks (1/75 of a second), in BCD. The last two bytes are the resource number of the ProG and STR# resources for this CD. Whenever a new CD is entered into the database, a new resource number is obtained by calling the Resource Manager routine Unique1ID.

An example IndX resource:

1214 0002 0B50 0240 276B 0C44 1365 1D0C

You would interpret this as:

version number: $1214

number of discs we know about: 2

number of tracks on first disc: 11

CD Identification: $500240; this is 50 minutes, 02 seconds, and 40 blocks (1/75 of a second)

Resource ID for ProG and STR# resources: 10091

number of tracks on second disc: 12

CD Identification: $441365; this is 44 minutes, 13 seconds, and 65 blocks (1/75 of a second)

Resource ID for ProG and STR# resources: 7436

The ResEdit TMPL template for the `IndX' resource is as follows:

resource 'TMPL' (128, "IndX", purgeable) {
         {         /* array ItemArray: 7 elements */
                   /* [1] */
                   "Version Number",
                   'HWRD',
                   /* [2] */
                   "Number of CDs",
                   'OCNT',
                   /* [3] */
                   "****",
                   'LSTC',
                   /* [4] */
                   "Number of tracks",
                   'DBYT',
                   /* [5] */
                   "Number of blocks on CD",
                   'H003',
                   /* [6] */
                   "Resource ID of ProG and STR#",
                   'DWRD',
                   /* [7] */
                   "****",
                   'LSTE'
          }
};

Back to top

'ProG' Resource Format

The 'ProG' resource contains the sequence for playing the audio tracks. By default, it goes from 1 to n, where n is the number of tracks on the CD. The numbers are stored in Binary Coded Decimal.

An example ProG resource:

000B 0101 0102 0103 0104 0105 0107 0106 0008 0109 0110 0111

You would interpret this as:

11 tracks on this disc.

Play track 7 before track 6

Don't play track 8

The ResEdit TMPL template for the `ProG' resource is as follows:

resource 'TMPL' (129, "ProG", purgeable)
            {        /* array ItemArray: 5 elements */
                     /* [1] */
                     "Number of tracks",
                     'OCNT',
                     /* [2] */
                     "****",
                     'LSTC',
                     /* [3] */
                     "Play this track (1 = yes)",
                     'DBYT',
                     /* [4] */
                     "Track number in BCD",
                     'HBYT',
                     /* [5] */
                     "****",
                     'LSTE'
            }
};

Back to top

'STR#' Resource

Each `STR#' resource contains a list of strings. The first string in each resource is the volume title. The next n strings contain the titles of each of the tracks on the CD. This order matches with the `ProG' resource order; the nth+1 title is for track n only if the `ProG' resource is in normal, default order. If the user has changed the track order, the order of the strings in the STR# resource changes as well.

The STR# resource format is two bytes containing the number of strings, followed by the strings. Each string is a one-byte length followed by the characters. The ResEdit template for STR# resources is predefined in ResEdit. If it were not, it would look like this:

resource 'TMPL' (258, "STR#", purgeable)
             {       /* array ItemArray: 4 elements */
                     /* [1] */
                     "NumStrings",
                     'OCNT',
                     /* [2] */
                     "*****",
                     'LSTC',
                     /* [3] */
                     "The string",
                     'PSTR',
                     /* [4] */
                     "*****",
                     'LSTE'
              }
};

Back to top

References

Inside Macintosh: Macintosh Toolbox Essentials, The Resource Manager

DV 22 - CD-ROM Driver Calls

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (52K)

Download


Back to top


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.