NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
REL="HOME"
TITLE="SDL Library Documentation"
REL="UP"
TITLE="SDL Reference"
HREF="reference.html"><
LINK
REL="PREVIOUS"
TITLE="SDL_CloseAudio"
HREF="sdlcloseaudio.html"><
LINK
REL="NEXT"
TITLE="SDL_CDNumDrives"
HREF="sdlcdnumdrives.html"><
META
NAME="KEYWORD"
NAME="KEYWORD"
CONTENT="function"><
/HEAD
CLASS="CHAPTER"
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="sdlcloseaudio.html"
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
HREF="sdlcdnumdrives.html"
ALIGN="LEFT"
CLASS="CHAPTER"
NAME="CDROM"
CLASS="TOC"
HREF="sdlcdnumdrives.html"
> &#
8212; Returns the number of CD-ROM drives on the system.<
/DT
HREF="sdlcdname.html"
> &#
8212; Returns a human-readable, system-dependent identifier
for the CD-ROM.<
/DT
HREF="sdlcdopen.html"
> &#
8212; Opens a CD-ROM drive
for access.<
/DT
HREF="sdlcdstatus.html"
> &#
8212; Returns the current status of the given drive.<
/DT
HREF="sdlcdplay.html"
HREF="sdlcdplaytracks.html"
> &#
8212; Play the given CD track
(s
)<
/DT
HREF="sdlcdpause.html"
> &#
8212; Pauses a CDROM<
/DT
HREF="sdlcdresume.html"
> &#
8212; Resumes a CDROM<
/DT
HREF="sdlcdstop.html"
> &#
8212; Stops a CDROM<
/DT
HREF="sdlcdeject.html"
> &#
8212; Ejects a CDROM<
/DT
HREF="sdlcdclose.html"
> &#
8212; Closes a SDL_CD handle<
/DT
HREF="sdlcd.html"
> &#
8212; CDROM Drive Information<
/DT
HREF="sdlcdtrack.html"
> &#
8212; CD Track Information Structure<
/DT
>SDL supports audio control of up to
32 local CD-ROM drives at once.<
/P
>You use this API to perform all the basic functions of a CD player,
including listing the tracks, playing, stopping, and ejecting the CD-ROM.
(Currently, multi-changer CD drives are not supported.
)<
/P
>Before you call any of the SDL CD-ROM functions, you must first call
"<TT
CLASS="FUNCTION"
>SDL_Init(SDL_INIT_CDROM)</TT
>", which scans the system for
CD-ROM drives, and sets the program up for audio control. Check the
return
code, which should be <
SPAN
CLASS="RETURNVALUE"
>, to see if there
were any errors in starting up.<
/P
>After you have initialized the library, you can find out how many drives
are available using the <
TT
CLASS="FUNCTION"
> function.
The first drive listed is the system default CD-ROM drive. After you have
chosen a drive, and have opened it with <
TT
CLASS="FUNCTION"
>,
you can check the status and start playing if there's a CD in the drive.</P
><P
>A CD-ROM is organized into one or more tracks, each consisting of a certain
number of "frames". Each frame is ~2K in size, and at normal playing speed,
a CD plays 75 frames per second. SDL works with the number of frames on a
CD, but this can easily be converted to the more familiar minutes/seconds
format by using the <TT
CLASS="FUNCTION"
>FRAMES_TO_MSF()</TT
> macro.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcloseaudio.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdnumdrives.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CloseAudio</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="reference.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDNumDrives</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>