home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !SDL / man / SDL_CDOpen.3 < prev    next >
Encoding:
Text File  |  2006-09-20  |  2.2 KB  |  80 lines

  1. <!-- manual page source format generated by PolyglotMan v3.0.8+X.Org, -->
  2. <!-- available at http://polyglotman.sourceforge.net/ -->
  3.  
  4. <html>
  5. <head>
  6. <title>"SDL_CDOpen"("3") manual page</title>
  7. </head>
  8. <body bgcolor='#efefef' text='black' link='blue' vlink='#551A8B' alink='red'>
  9. <a href='#toc'>Table of Contents</a><p>
  10.  
  11. <h2><a name='sect0' href='#toc0'>Name</a></h2>
  12. SDL_CDOpen- Opens a CD-ROM drive for access. 
  13. <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
  14. <p>
  15. <b>#include "SDL.h" <p>
  16. </b><b>SDL_CD
  17. *<b>SDL_CDOpen</b></b>(<b>int drive</b>); 
  18. <h2><a name='sect2' href='#toc2'>Description</a></h2>
  19. <p>
  20. Opens a CD-ROM drive for access. It returns
  21. a <i><b>SDL_CD</b></i> structure on success, or <b>NULL</b> if the drive was invalid or busy.
  22. This newly opened CD-ROM becomes the default CD used when other CD functions
  23. are passed a <b>NULL</b> CD-ROM handle.  <p>
  24. Drives are numbered starting with 0. Drive
  25. 0 is the system default CD-ROM. 
  26. <h2><a name='sect3' href='#toc3'>Examples</a></h2>
  27. <p>
  28. <br>
  29. <pre>CWSDL_CD *cdrom;
  30. int cur_track;
  31. int min, sec, frame;
  32. SDL_Init(SDL_INIT_CDROM);
  33. atexit(SDL_Quit);
  34. /* Check for CD drives */
  35. if(!SDL_CDNumDrives()){
  36.   /* None found */
  37.   fprintf(stderr, "No CDROM devices available
  38. ");
  39.   exit(-1);
  40. }
  41. /* Open the default drive */
  42. cdrom=SDL_CDOpen(0);
  43. /* Did if open? Check if cdrom is NULL */
  44. if(!cdrom){
  45.   fprintf(stderr, "Couldn't open drive: %s
  46. ", SDL_GetError());
  47.   exit(-1);
  48. }
  49. /* Print Volume info */
  50. printf("Name: %s
  51. ", SDL_CDName(0));
  52. printf("Tracks: %d
  53. ", cdrom->numtracks);
  54. for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
  55.   FRAMES_TO_MSF(cdrom->track[cur_track].length, &min, &sec, &frame);
  56.   printf("<tt> </tt> <tt> </tt> Track %d: Length %d:%d
  57. ", cur_track, min, sec);
  58. }
  59. SDL_CDClose(cdrom);
  60. </pre><p>
  61.  
  62. <h2><a name='sect4' href='#toc4'>See Also</a></h2>
  63. <p>
  64. <i><b>SDL_CD</b></i>, <i><b>SDL_CDtrack</b></i>, <i><b>SDL_CDClose</b></i> 
  65. <!--
  66.   
  67.  <p>
  68.  
  69. <hr><p>
  70. <a name='toc'><b>Table of Contents</b></a><p>
  71. <ul>
  72. <li><a name='toc0' href='#sect0'>Name</a></li>
  73. <li><a name='toc1' href='#sect1'>Synopsis</a></li>
  74. <li><a name='toc2' href='#sect2'>Description</a></li>
  75. <li><a name='toc3' href='#sect3'>Examples</a></li>
  76. <li><a name='toc4' href='#sect4'>See Also</a></li>
  77. </ul>
  78. </body>
  79. </html>
  80.