1SDL_CD(3)                      SDL API Reference                     SDL_CD(3)
2
3
4

NAME

6       SDL_CD - CDROM Drive Information
7

STRUCTURE DEFINITION

9       typedef struct{
10         int id;
11         CDstatus status;
12         int numtracks;
13         int cur_track;
14         int cur_frame;
15         SDL_CDtrack track[SDL_MAX_TRACKS+1];
16       } SDL_CD;
17

STRUCTURE DATA

19       id                  Private drive identifier
20
21       status              Drive status
22
23       numtracks           Number of tracks on the CD
24
25       cur_track           Current track
26
27       cur_frame           Current frame offset within the track
28
29       track[SDL_MAX_TRACKS+1]
30                           Array of track descriptions. (see SDL_CDtrack)
31

DESCRIPTION

33       An  SDL_CD structure is returned by SDL_CDOpen. It represents an opened
34       CDROM device and stores information on the layout of the tracks on  the
35       disc.
36
37       A frame is the base data unit of a CD. CD_FPS frames is equal to 1 sec‐
38       ond of music. SDL provides two macros for converting between  time  and
39       frames: FRAMES_TO_MSF(f, M,S,F) and MSF_TO_FRAMES.
40

EXAMPLES

42       int min, sec, frame;
43       int frame_offset;
44
45       FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame);
46       printf("Current Position: %d minutes, %d seconds, %d frames
47       ", min, sec, frame);
48
49       frame_offset=MSF_TO_FRAMES(min, sec, frame);
50

SEE ALSO

52       SDL_CDOpen, SDL_CDtrack
53
54
55
56SDL                         Tue 11 Sep 2001, 22:58                   SDL_CD(3)
Impressum