docs/man3/SDL_CD.3
author Sam Lantinga <slouken@libsdl.org>
Wed, 08 Mar 2006 18:30:12 +0000
changeset 1486 9d77fc9d0ace
parent 181 e5bc29de3f0a
child 2283 546f7c1eb755
permissions -rw-r--r--
Re-added C runtime support for Visual C++ 5,6
slouken@181
     1
.TH "SDL_CD" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" 
slouken@0
     2
.SH "NAME"
slouken@0
     3
SDL_CD\- CDROM Drive Information
slouken@0
     4
.SH "STRUCTURE DEFINITION"
slouken@0
     5
.PP
slouken@0
     6
.nf
slouken@0
     7
\f(CWtypedef struct{
slouken@0
     8
  int id;
slouken@0
     9
  CDstatus status;
slouken@0
    10
  int numtracks;
slouken@0
    11
  int cur_track;
slouken@0
    12
  int cur_frame;
slouken@0
    13
  SDL_CDtrack track[SDL_MAX_TRACKS+1];
slouken@0
    14
} SDL_CD;\fR
slouken@0
    15
.fi
slouken@0
    16
.PP
slouken@0
    17
.SH "STRUCTURE DATA"
slouken@0
    18
.TP 20
slouken@0
    19
\fBid\fR
slouken@0
    20
Private drive identifier
slouken@0
    21
.TP 20
slouken@0
    22
\fBstatus\fR
slouken@0
    23
Drive \fIstatus\fR
slouken@0
    24
.TP 20
slouken@0
    25
\fBnumtracks\fR
slouken@0
    26
Number of tracks on the CD
slouken@0
    27
.TP 20
slouken@0
    28
\fBcur_track\fR
slouken@0
    29
Current track
slouken@0
    30
.TP 20
slouken@0
    31
\fBcur_frame\fR
slouken@0
    32
Current frame offset within the track
slouken@0
    33
.TP 20
slouken@0
    34
\fBtrack\fR[SDL_MAX_TRACKS+1]
slouken@0
    35
Array of track descriptions\&. (see \fI\fBSDL_CDtrack\fR\fR)
slouken@0
    36
.SH "DESCRIPTION"
slouken@0
    37
.PP
slouken@0
    38
An \fBSDL_CD\fR structure is returned by \fI\fBSDL_CDOpen\fP\fR\&. It represents an opened CDROM device and stores information on the layout of the tracks on the disc\&.
slouken@0
    39
.PP
slouken@0
    40
A frame is the base data unit of a CD\&. \fBCD_FPS\fP frames is equal to 1 second of music\&. SDL provides two macros for converting between time and frames: \fBFRAMES_TO_MSF(f, M,S,F)\fP and \fBMSF_TO_FRAMES\fP\&.
slouken@0
    41
.SH "EXAMPLES"
slouken@0
    42
.PP
slouken@0
    43
.nf
slouken@0
    44
\f(CWint min, sec, frame;
slouken@0
    45
int frame_offset;
slouken@0
    46
slouken@0
    47
FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame);
slouken@0
    48
printf("Current Position: %d minutes, %d seconds, %d frames
slouken@0
    49
", min, sec, frame);
slouken@0
    50
slouken@0
    51
frame_offset=MSF_TO_FRAMES(min, sec, frame);\fR
slouken@0
    52
.fi
slouken@0
    53
.PP
slouken@0
    54
.SH "SEE ALSO"
slouken@0
    55
.PP
slouken@0
    56
\fI\fBSDL_CDOpen\fP\fR, \fI\fBSDL_CDtrack\fR\fR
slouken@181
    57
...\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58