comparison test/testaudioinfo.c @ 2060:866052b01ee5

indent is evil
author Sam Lantinga <slouken@libsdl.org>
date Sat, 28 Oct 2006 16:48:03 +0000
parents 5f6550e5184f
children 9de326b3099c
comparison
equal deleted inserted replaced
2059:4685ccd33d0e 2060:866052b01ee5
1 #include "SDL.h" 1 #include "SDL.h"
2 2
3 static void print_devices(int iscapture) 3 static void
4 print_devices(int iscapture)
4 { 5 {
5 const char *typestr = ((iscapture) ? "capture" : "output"); 6 const char *typestr = ((iscapture) ? "capture" : "output");
6 int n = SDL_GetNumAudioDevices(iscapture); 7 int n = SDL_GetNumAudioDevices(iscapture);
7 8
8 printf("%s devices:\n", typestr); 9 printf("%s devices:\n", typestr);
9 10
10 if (n == -1) 11 if (n == -1)
11 printf(" Driver can't detect specific devices.\n\n", typestr); 12 printf(" Driver can't detect specific devices.\n\n", typestr);
12 else if (n == 0) 13 else if (n == 0)
13 printf(" No %s devices found.\n\n", typestr); 14 printf(" No %s devices found.\n\n", typestr);
14 else 15 else {
15 {
16 int i; 16 int i;
17 for (i = 0; i < n; i++) { 17 for (i = 0; i < n; i++) {
18 printf(" %s\n", SDL_GetAudioDeviceName(i, iscapture)); 18 printf(" %s\n", SDL_GetAudioDeviceName(i, iscapture));
19 } 19 }
20 printf("\n"); 20 printf("\n");
21 } 21 }
22 } 22 }
23 23
24 int main(int argc, char **argv) 24 int
25 main(int argc, char **argv)
25 { 26 {
26 /* Print available audio drivers */ 27 /* Print available audio drivers */
27 int n = SDL_GetNumAudioDrivers(); 28 int n = SDL_GetNumAudioDrivers();
28 if (n == 0) { 29 if (n == 0) {
29 printf("No built-in audio drivers\n\n"); 30 printf("No built-in audio drivers\n\n");
48 print_devices(1); 49 print_devices(1);
49 50
50 SDL_Quit(); 51 SDL_Quit();
51 return 0; 52 return 0;
52 } 53 }
53