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_CDOpen"("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_CDOpen- Opens a CD-ROM drive for access.
- <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
- <p>
- <b>#include "SDL.h" <p>
- </b><b>SDL_CD
- *<b>SDL_CDOpen</b></b>(<b>int drive</b>);
- <h2><a name='sect2' href='#toc2'>Description</a></h2>
- <p>
- Opens a CD-ROM drive for access. It returns
- a <i><b>SDL_CD</b></i> structure on success, or <b>NULL</b> if the drive was invalid or busy.
- This newly opened CD-ROM becomes the default CD used when other CD functions
- are passed a <b>NULL</b> CD-ROM handle. <p>
- Drives are numbered starting with 0. Drive
- 0 is the system default CD-ROM.
- <h2><a name='sect3' href='#toc3'>Examples</a></h2>
- <p>
- <br>
- <pre>CWSDL_CD *cdrom;
- int cur_track;
- int min, sec, frame;
- SDL_Init(SDL_INIT_CDROM);
- atexit(SDL_Quit);
- /* Check for CD drives */
- if(!SDL_CDNumDrives()){
- /* None found */
- fprintf(stderr, "No CDROM devices available
- ");
- exit(-1);
- }
- /* Open the default drive */
- cdrom=SDL_CDOpen(0);
- /* Did if open? Check if cdrom is NULL */
- if(!cdrom){
- fprintf(stderr, "Couldn't open drive: %s
- ", SDL_GetError());
- exit(-1);
- }
- /* Print Volume info */
- printf("Name: %s
- ", SDL_CDName(0));
- printf("Tracks: %d
- ", cdrom->numtracks);
- for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
- FRAMES_TO_MSF(cdrom->track[cur_track].length, &min, &sec, &frame);
- printf("<tt> </tt> <tt> </tt> Track %d: Length %d:%d
- ", cur_track, min, sec);
- }
- SDL_CDClose(cdrom);
- </pre><p>
-
- <h2><a name='sect4' href='#toc4'>See Also</a></h2>
- <p>
- <i><b>SDL_CD</b></i>, <i><b>SDL_CDtrack</b></i>, <i><b>SDL_CDClose</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'>Examples</a></li>
- <li><a name='toc4' href='#sect4'>See Also</a></li>
- </ul>
- </body>
- </html>
-