TSDL_CD

Name

  TSDL_CD -- CDROM Drive Information

Structure Definition

  TSDL_CD = record
id : Integer; // Private drive identifier
status : TSDL_CDStatus; // Current drive status
numtracks : Integer; // Number of tracks on disk
cur_track : Integer; // Current track position
cur_frame : Integer; // Current frame offset within current track
track : array[0..SDL_MAX_TRACKS] of TSDL_CDTrack;
end;

Structure Data

id Private drive identifier
status Drive status
numtracks Number of tracks on the CD
cur_track Current track
cur_frame Current frame offset within the track
track [SDL_MAX_TRACKS+1] Array of track descriptions. (see TSDL_CDTrack)

Description

An TSDL_CD structure is returned by SDL_CDOpen. It represents an opened CDROM device and stores information on the layout of the tracks on the disc.

A frame is the base data unit of a CD. CD_FPS frames is equal to 1 second of music. SDL provides two macros for converting between time and frames: FRAMES_TO_MSF(f, M,S,F) and MSF_TO_FRAMES.

Examples

min, sec, frame : integer;
frame_offset : integer;

FRAMES_TO_MSF( cdrom.cur_frame, min, sec, frame );
WriteLn( Format( 'Current Position: %d minutes, %d seconds, %d frames', [ min, sec, frame ] ) );

frame_offset := MSF_TO_FRAMES( min, sec, frame );

See Also

SDL_CDOpen, TSDL_CDtrack