test/testcdrom.c
changeset 568 0cd6b268193b
parent 0 74212992fb08
child 613 9c6717a1c66f
equal deleted inserted replaced
567:969fbd4dcd4e 568:0cd6b268193b
    42 
    42 
    43 static void ListTracks(SDL_CD *cdrom)
    43 static void ListTracks(SDL_CD *cdrom)
    44 {
    44 {
    45 	int i;
    45 	int i;
    46 	int m, s, f;
    46 	int m, s, f;
       
    47 	char* trtype;
    47 
    48 
    48 	SDL_CDStatus(cdrom);
    49 	SDL_CDStatus(cdrom);
    49 	printf("Drive tracks: %d\n", cdrom->numtracks);
    50 	printf("Drive tracks: %d\n", cdrom->numtracks);
    50 	for ( i=0; i<cdrom->numtracks; ++i ) {
    51 	for ( i=0; i<cdrom->numtracks; ++i ) {
    51 		FRAMES_TO_MSF(cdrom->track[i].length, &m, &s, &f);
    52 		FRAMES_TO_MSF(cdrom->track[i].length, &m, &s, &f);
    52 		if ( f > 0 )
    53 		if ( f > 0 )
    53 			++s;
    54 			++s;
    54 		printf("\tTrack (index %d) %d: %d:%2.2d\n", i,
    55 		switch(cdrom->track[i].type)
    55 					cdrom->track[i].id, m, s);
    56 		{
       
    57 		    case SDL_AUDIO_TRACK:
       
    58 			trtype="audio";
       
    59 			break;
       
    60 		    case SDL_DATA_TRACK:
       
    61 			trtype="data";
       
    62 			break;
       
    63 		    default:
       
    64 			trtype="unknown";
       
    65 			break;
       
    66 		}
       
    67 		printf("\tTrack (index %d) %d: %d:%2.2d [%s track]\n", i,
       
    68 					cdrom->track[i].id, m, s, trtype);
    56 	}
    69 	}
    57 }
    70 }
    58 
    71 
    59 static void PrintUsage(char *argv0)
    72 static void PrintUsage(char *argv0)
    60 {
    73 {