?? cdrom.html
字號:
<HTML><HEAD><TITLE>CD-ROM</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="SDL Library Documentation"HREF="index.html"><LINKREL="UP"TITLE="SDL Reference"HREF="reference.html"><LINKREL="PREVIOUS"TITLE="SDL_CloseAudio"HREF="sdlcloseaudio.html"><LINKREL="NEXT"TITLE="SDL_CDNumDrives"HREF="sdlcdnumdrives.html"><METANAME="KEYWORD"CONTENT="cdrom"><METANAME="KEYWORD"CONTENT="function"></HEAD><BODYCLASS="CHAPTER"BGCOLOR="#FFF8DC"TEXT="#000000"LINK="#0000ee"VLINK="#551a8b"ALINK="#ff0000"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">SDL Library Documentation</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="sdlcloseaudio.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="sdlcdnumdrives.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="CDROM"></A>Chapter 11. CD-ROM</H1><DIVCLASS="TOC"><DL><DT><B>Table of Contents</B></DT><DT><AHREF="sdlcdnumdrives.html">SDL_CDNumDrives</A> -- Returns the number of CD-ROM drives on the system.</DT><DT><AHREF="sdlcdname.html">SDL_CDName</A> -- Returns a human-readable, system-dependent identifier for the CD-ROM.</DT><DT><AHREF="sdlcdopen.html">SDL_CDOpen</A> -- Opens a CD-ROM drive for access.</DT><DT><AHREF="sdlcdstatus.html">SDL_CDStatus</A> -- Returns the current status of the given drive.</DT><DT><AHREF="sdlcdplay.html">SDL_CDPlay</A> -- Play a CD</DT><DT><AHREF="sdlcdplaytracks.html">SDL_CDPlayTracks</A> -- Play the given CD track(s)</DT><DT><AHREF="sdlcdpause.html">SDL_CDPause</A> -- Pauses a CDROM</DT><DT><AHREF="sdlcdresume.html">SDL_CDResume</A> -- Resumes a CDROM</DT><DT><AHREF="sdlcdstop.html">SDL_CDStop</A> -- Stops a CDROM</DT><DT><AHREF="sdlcdeject.html">SDL_CDEject</A> -- Ejects a CDROM</DT><DT><AHREF="sdlcdclose.html">SDL_CDClose</A> -- Closes a SDL_CD handle</DT><DT><AHREF="sdlcd.html">SDL_CD</A> -- CDROM Drive Information</DT><DT><AHREF="sdlcdtrack.html">SDL_CDtrack</A> -- CD Track Information Structure</DT></DL></DIV><P>SDL supports audio control of up to 32 local CD-ROM drives at once.</P><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><P>Before you call any of the SDL CD-ROM functions, you must first call"<TTCLASS="FUNCTION">SDL_Init(SDL_INIT_CDROM)</TT>", which scans the system forCD-ROM drives, and sets the program up for audio control. Check the return code, which should be <SPANCLASS="RETURNVALUE">0</SPAN>, to see if there were any errors in starting up.</P><P>After you have initialized the library, you can find out how many drivesare available using the <TTCLASS="FUNCTION">SDL_CDNumDrives()</TT> function. The first drive listed is the system default CD-ROM drive. After you have chosen a drive, and have opened it with <TTCLASS="FUNCTION">SDL_CDOpen()</TT>, 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 certainnumber 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 aCD, but this can easily be converted to the more familiar minutes/secondsformat by using the <TTCLASS="FUNCTION">FRAMES_TO_MSF()</TT> macro.</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="sdlcloseaudio.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="index.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="sdlcdnumdrives.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">SDL_CloseAudio</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="reference.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">SDL_CDNumDrives</TD></TR></TABLE></DIV></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -