a1200   NEWS   APPS   DOCS   ABOUT
a1200
----
a1200
----
Autodocs
 Devices:
 cd.device
  CD_ADDCHANGEINT
  CD_ADDFRAMEINT
  CD_ATTENUATE
  CD_CHANGENUM
  CD_CHANGESTATE
  CD_CONFIG
  CD_EJECT
  CD_GETGEOMETRY
  CD_INFO
  CD_MOTOR
  CD_PAUSE
  CD_PLAYLSN
  CD_PLAYMSF
  CD_PLAYTRACK
  CD_PROTSTATUS
  CD_QCODELSN
  CD_QCODEMSF
  CD_READ
  CD_READXL
  CD_REMCHANGEINT
  CD_REMFRAMEINT
  CD_SEARCH
  CD_SEEK
  CD_TOCLSN
  CD_TOCMSF
  CloseDevice
  OpenDevice
Include
GuruMeditation
Docs » Autodocs » cd.device » CD_TOCLSN

NAME

       CD_TOCLSN -- Return table of contents information from CD (LSN form).
IO REQUEST
io_Device preset by the call to OpenDevice()
io_Unit preset by the call to OpenDevice()
io_Command CD_TOCLSN
io_Data pointer to array where TOC is to be stored
io_Length number of CDTOC entries to be fetched
io_Offset entry to begin at (entry 0 is summary information)

RESULT

       io_Error        0 for success, or an error code as defined in
<devices/cd.h>
io_Actual Actual number of entries copied

FUNCTION

       This command returns the table of contents of the disk currently in
the drive. The table of contents consists of up to 100 entries.
Entry zero is summary information describing the number of tracks
and the total number of minutes on the disk. Entries 1 through N
contain information about each individual track. All position
information will be in LSN format.
The io_Data field points to an array of CDTOC structures to receive
the TOC data.
The io_Length field specifies the total number of entries to be
fetched. The array pointed to by io_Data must be at least this many
elements in size.
The io_Offset field specifies the entry number at which to start
copying TOC data into *io_Data.
Entry zero (the summary entry) contains the following:
struct TOCSummary {
UBYTE FirstTrack; /* First track on disk (always 1) */
UBYTE LastTrack; /* Last track on disk */
union LSNMSF LeadOut; /* Beginning of lead-out track */
};
Track entries (entries 1 through number of tracks) contain:
struct TOCEntry {
UBYTE CtlAdr; /* Q-Code info */
UBYTE Track; /* Track number */
union LSNMSF Position; /* Start position of this track */
};
CDTOC is described as a union between these two structures:
union CDTOC {
struct TOCSummary Summary; /* First entry is summary info. */
struct TOCEntry Entry; /* Entries 1-N are track entries */
};

EXAMPLE

       union CDTOC tocarray[100];
ior->io_Command = CD_TOCLSN; /* Retrieve TOC information */
ior->io_Offset = 0; /* Start with summary info */
ior->io_Length = 100; /* Max 99 tracks + summary */
ior->io_Data = (APTR)tocarray; /* Here's where we want it */
DoIO (ior);
if (!ior->io_Error) { /* Command succeeded */
firsttrack = tocarray[0].Summary.FirstTrack;
lasttrack = tocarray[0].Summary.LastTrack;
totalsectors = tocarray[0].Summary.LeadOut.LSN -
tocarray[1].Entry.Position.LSN;
}

NOTES

       In the above example, the amount of data on the disk is calculated as
being equal to the location of the lead-out track minus the start of
the first track (which is never zero).

BUGS

SEE ALSO

Comments

Name:
E-mail: Use this if you want a message if you get a response, will not be shown.
Comment:
Select correct short for:

The Silents

ANA
TSL
FLT
SNT

Comments:

$VER: d0.se 1.14 Copyright © 2011-2024 Tobias Geijersson support at d0 dot se