Date: Thu, 16 Jan 2003 13:48:31 +0200
authorSam Lantinga <slouken@libsdl.org>
Mon, 20 Jan 2003 01:35:44 +0000
changeset 568 0cd6b268193b
parent 567 969fbd4dcd4e
child 569 e8063c656626
Date: Thu, 16 Jan 2003 13:48:31 +0200 From: "Mike Gorchak" added showing of type of the track, when adding -list arg
test/testcdrom.c
--- a/test/testcdrom.c	Mon Jan 20 01:08:20 2003 +0000
+++ b/test/testcdrom.c	Mon Jan 20 01:35:44 2003 +0000
@@ -44,6 +44,7 @@
 {
 	int i;
 	int m, s, f;
+	char* trtype;
 
 	SDL_CDStatus(cdrom);
 	printf("Drive tracks: %d\n", cdrom->numtracks);
@@ -51,8 +52,20 @@
 		FRAMES_TO_MSF(cdrom->track[i].length, &m, &s, &f);
 		if ( f > 0 )
 			++s;
-		printf("\tTrack (index %d) %d: %d:%2.2d\n", i,
-					cdrom->track[i].id, m, s);
+		switch(cdrom->track[i].type)
+		{
+		    case SDL_AUDIO_TRACK:
+			trtype="audio";
+			break;
+		    case SDL_DATA_TRACK:
+			trtype="data";
+			break;
+		    default:
+			trtype="unknown";
+			break;
+		}
+		printf("\tTrack (index %d) %d: %d:%2.2d [%s track]\n", i,
+					cdrom->track[i].id, m, s, trtype);
 	}
 }