playmus.c
changeset 214 ab571e095c22
parent 155 53f259dae79d
child 241 503416fca921
     1.1 --- a/playmus.c	Wed Feb 12 05:07:12 2003 +0000
     1.2 +++ b/playmus.c	Wed Feb 12 05:40:57 2003 +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] [-s] <musicfile>\n", argv0);
     1.8 +	fprintf(stderr, "Usage: %s [-i] [-l] [-8] [-r rate] [-b buffers] [-v N] <musicfile>\n", argv0);
     1.9  }
    1.10  
    1.11  void Menu(void)
    1.12 @@ -97,6 +97,7 @@
    1.13  	Uint16 audio_format;
    1.14  	int audio_channels;
    1.15  	int audio_buffers;
    1.16 +	int audio_volume = MIX_MAX_VOLUME;
    1.17  	int looping = 0;
    1.18  	int interactive = 0;
    1.19  	int i;
    1.20 @@ -117,6 +118,10 @@
    1.21  			++i;
    1.22  			audio_buffers = atoi(argv[i]);
    1.23  		} else
    1.24 +		if ( (strcmp(argv[i], "-v") == 0) && argv[i+1] ) {
    1.25 +			++i;
    1.26 +			audio_volume = atoi(argv[i]);
    1.27 +		} else
    1.28  		if ( strcmp(argv[i], "-m") == 0 ) {
    1.29  			audio_channels = 1;
    1.30  		} else
    1.31 @@ -160,6 +165,9 @@
    1.32  	}
    1.33  	audio_open = 1;
    1.34  
    1.35 +	/* Set the music volume */
    1.36 +	Mix_VolumeMusic(audio_volume);
    1.37 +
    1.38  	/* Set the external music player, if any */
    1.39  	Mix_SetMusicCMD(getenv("MUSIC_CMD"));
    1.40