CD-ROM
SDL supports audio control of up to 32 local CD-ROM drives at once.
Before you call any of the SDL CD-ROM functions, you must first call
" After you have initialized the library, you can find out how many drives are available using the SDL_CDNumDrives() function. The first drive listed is the system default CD-ROM drive. After you have chosen a drive, and have opened it with SDL_CDOpen(), you can check the status and start playing if there's a CD in the drive. 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 FRAMES_TO_MSF() macro. Here are some examples to get you started. |