home *** CD-ROM | disk | FTP | other *** search
- <!-- manual page source format generated by PolyglotMan v3.0.8+X.Org, -->
- <!-- available at http://polyglotman.sourceforge.net/ -->
-
- <html>
- <head>
- <title>"SDL_CDStatus"("3") manual page</title>
- </head>
- <body bgcolor='#efefef' text='black' link='blue' vlink='#551A8B' alink='red'>
- <a href='#toc'>Table of Contents</a><p>
-
- <h2><a name='sect0' href='#toc0'>Name</a></h2>
- SDL_CDStatus- Returns the current status of the given drive.
- <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
- <p>
- <b>#include
- "SDL.h" <p>
- </b><b>CDstatus <b>SDL_CDStatus</b></b>(<b>SDL_CD *cdrom</b>); <b>/* Given a status, returns
- true if there's a disk in the drive */ #define CD_INDRIVE(status) ((int)status
- > 0)
- <h2><a name='sect2' href='#toc2'></b>Description</a></h2>
- <p>
- This function returns the current status of the given drive.
- Status is described like so: <p>
- <br>
- <pre>CWtypedef enum {
- CD_TRAYEMPTY,
- CD_STOPPED,
- CD_PLAYING,
- CD_PAUSED,
- CD_ERROR = -1
- } CDstatus;
- </pre><p>
- <p>
- If the drive has a CD in it, the table of contents of the CD and current
- play position of the CD will be stored in the SDL_CD structure. <p>
- The macro
- <b>CD_INDRIVE</b> is provided for convenience, and given a status returns true
- if there's a disk in the drive. <p>
- <blockquote><b>Note: <p>
- <b>SDL_CDStatus</b></b> also updates the <i><b>SDL_CD</b></i>
- structure passed to it. </blockquote>
-
- <h2><a name='sect3' href='#toc3'>Example</a></h2>
- <p>
- <br>
- <pre>CWint playTrack(int track)
- {
- int playing = 0;
- if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
- /* clamp to the actual number of tracks on the CD */
- if (track >= cdrom->numtracks) {
- track = cdrom->numtracks-1;
- }
- if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) {
- playing = 1;
- }
- }
- return playing;
- }
- </pre><p>
-
- <h2><a name='sect4' href='#toc4'>See Also</a></h2>
- <p>
- <i><b>SDL_CD</b></i>
- <!--
-
- <p>
-
- <hr><p>
- <a name='toc'><b>Table of Contents</b></a><p>
- <ul>
- <li><a name='toc0' href='#sect0'>Name</a></li>
- <li><a name='toc1' href='#sect1'>Synopsis</a></li>
- <li><a name='toc2' href='#sect2'>Description</a></li>
- <li><a name='toc3' href='#sect3'>Example</a></li>
- <li><a name='toc4' href='#sect4'>See Also</a></li>
- </ul>
- </body>
- </html>
-