Blame |
Last modification |
View Log
| RSS feed
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
REL="HOME"
TITLE="SDL Library Documentation"
REL="UP"
TITLE="CD-ROM"
REL="PREVIOUS"
TITLE="SDL_CDClose"
HREF="sdlcdclose.html"><
LINK
REL="NEXT"
TITLE="SDL_CDtrack"
HREF="sdlcdtrack.html"><
/HEAD
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
CLASS="NAVHEADER"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation<
/TH
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
HREF="sdlcdclose.html"
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
HREF="sdlcdtrack.html"
ALIGN="LEFT"
NAME="SDLCD"
CLASS="REFNAMEDIV"
NAME="AEN7017"
>SDL_CD -- CDROM Drive Information<
/DIV
CLASS="REFSECT1"
NAME="AEN7020"
>Structure Definition<
/H2
CLASS="PROGRAMLISTING"
>typedef struct{
int id;
CDstatus status;
int numtracks;
int cur_track;
int cur_frame;
SDL_CDtrack track[SDL_MAX_TRACKS+1];
CLASS="REFSECT1"
NAME="AEN7023"
CLASS="INFORMALTABLE"
NAME="AEN7025"
BORDER="0"
CLASS="CALSTABLE"
ALIGN="LEFT"
VALIGN="TOP"
CLASS="STRUCTFIELD"
ALIGN="LEFT"
VALIGN="TOP"
>Private drive identifier<
/TD
ALIGN="LEFT"
VALIGN="TOP"
CLASS="STRUCTFIELD"
ALIGN="LEFT"
VALIGN="TOP"
HREF="sdlcdstatus.html"
ALIGN="LEFT"
VALIGN="TOP"
CLASS="STRUCTFIELD"
ALIGN="LEFT"
VALIGN="TOP"
>Number of tracks on the CD<
/TD
ALIGN="LEFT"
VALIGN="TOP"
CLASS="STRUCTFIELD"
ALIGN="LEFT"
VALIGN="TOP"
ALIGN="LEFT"
VALIGN="TOP"
CLASS="STRUCTFIELD"
ALIGN="LEFT"
VALIGN="TOP"
>Current
frame offset within the track<
/TD
ALIGN="LEFT"
VALIGN="TOP"
CLASS="STRUCTFIELD"
ALIGN="LEFT"
VALIGN="TOP"
>Array of track descriptions.
(see <
A
HREF="sdlcdtrack.html"
CLASS="STRUCTNAME"
CLASS="REFSECT1"
NAME="AEN7055"
CLASS="STRUCTNAME"
> structure is returned by <
A
HREF="sdlcdopen.html"
CLASS="FUNCTION"
>. It represents an opened CDROM device and stores information on the layout of the tracks on the disc.<
/P
>A
frame is the base
data unit of a CD. <
TT
CLASS="LITERAL"
> frames is equal to
1 second of music. SDL provides two macros
for converting between time and frames: <
TT
CLASS="LITERAL"
>FRAMES_TO_MSF
(f, M,S,F
)<
/TT
CLASS="LITERAL"
CLASS="REFSECT1"
NAME="AEN7065"
CLASS="PROGRAMLISTING"
>int min, sec, frame;
int frame_offset;
FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame);
printf("Current Position: %d minutes, %d seconds, %d frames\n", min, sec, frame);
frame_offset
=MSF_TO_FRAMES
(min, sec,
frame);<
/PRE
CLASS="REFSECT1"
NAME="AEN7068"
HREF="sdlcdopen.html"
CLASS="FUNCTION"
>,
HREF="sdlcdtrack.html"
CLASS="STRUCTNAME"
CLASS="NAVFOOTER"
ALIGN="LEFT"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
WIDTH="33%"
ALIGN="left"
VALIGN="top"
HREF="sdlcdclose.html"
WIDTH="34%"
ALIGN="center"
VALIGN="top"
HREF="index.html"
WIDTH="33%"
ALIGN="right"
VALIGN="top"
HREF="sdlcdtrack.html"
WIDTH="33%"
ALIGN="left"
VALIGN="top"
WIDTH="34%"
ALIGN="center"
VALIGN="top"
HREF="cdrom.html"
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>