playmus.c
changeset 245 63b3650714de
parent 241 503416fca921
child 256 6d7e102500c9
     1.1 --- a/playmus.c	Fri Aug 20 19:32:09 2004 +0000
     1.2 +++ b/playmus.c	Sat Aug 21 12:27:02 2004 +0000
     1.3 @@ -57,7 +57,7 @@
     1.4  
     1.5  void Usage(char *argv0)
     1.6  {
     1.7 -	fprintf(stderr, "Usage: %s [-i] [-l] [-8] [-r rate] [-b buffers] [-v N] <musicfile>\n", argv0);
     1.8 +	fprintf(stderr, "Usage: %s [-i] [-l] [-8] [-r rate] [-c channels] [-b buffers] [-v N] <musicfile>\n", argv0);
     1.9  }
    1.10  
    1.11  void Menu(void)
    1.12 @@ -114,6 +114,13 @@
    1.13  			++i;
    1.14  			audio_rate = atoi(argv[i]);
    1.15  		} else
    1.16 +		if ( strcmp(argv[i], "-m") == 0 ) {
    1.17 +			audio_channels = 1;
    1.18 +		} else
    1.19 +		if ( (strcmp(argv[i], "-c") == 0) && argv[i+1] ) {
    1.20 +			++i;
    1.21 +			audio_channels = atoi(argv[i]);
    1.22 +		} else
    1.23  		if ( (strcmp(argv[i], "-b") == 0) && argv[i+1] ) {
    1.24  			++i;
    1.25  			audio_buffers = atoi(argv[i]);
    1.26 @@ -122,9 +129,6 @@
    1.27  			++i;
    1.28  			audio_volume = atoi(argv[i]);
    1.29  		} else
    1.30 -		if ( strcmp(argv[i], "-m") == 0 ) {
    1.31 -			audio_channels = 1;
    1.32 -		} else
    1.33  		if ( strcmp(argv[i], "-l") == 0 ) {
    1.34  			looping = -1;
    1.35  		} else
    1.36 @@ -148,6 +152,7 @@
    1.37  		fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
    1.38  		return(255);
    1.39  	}
    1.40 +
    1.41  	atexit(CleanUp);
    1.42  	signal(SIGINT, IntHandler);
    1.43  	signal(SIGTERM, exit);
    1.44 @@ -160,7 +165,7 @@
    1.45  		Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
    1.46  		printf("Opened audio at %d Hz %d bit %s, %d bytes audio buffer\n", audio_rate,
    1.47  			(audio_format&0xFF),
    1.48 -			(audio_channels > 1) ? "stereo" : "mono", 
    1.49 +			(audio_channels > 2) ? "surround" : (audio_channels > 1) ? "stereo" : "mono", 
    1.50  			audio_buffers );
    1.51  	}
    1.52  	audio_open = 1;