CDROM Audio

SDL_CD Structure

Calling "SDL_CDStatus()" also updates the contents of the "SDL_CD" structure. Let's look inside:

SDL_Status(cdrom);

for (i = 0; i < cdrom->numtracks; i++)
  {
    printf("Track %d: %d seconds.\n",
           i + 1,
           cdrom->track[i].length / CD_FPS);
  }

Note: Track lengths are in "frames," which are 1/75th's of seconds. They are defined by "CD_FPS."