X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dos_auplay;a=blobdiff_plain;f=src%2Fmain.c;h=8fa1126734fd25195921c3aba84526bd8aff3f8c;hp=c88aa3b39bfabd7f80f3ea86a2325abc92804ad7;hb=de258a48248718966db128978096931c52f6e203;hpb=6e29178202fe1876a0fb0231e71fa0e75a7b6460 diff --git a/src/main.c b/src/main.c index c88aa3b..8fa1126 100644 --- a/src/main.c +++ b/src/main.c @@ -17,17 +17,24 @@ static int quit; int main(int argc, char **argv) { - int i; + int i, vol; if(audio_init() == -1) { return 1; } - audio_setvolume(AUDIO_MASTER, 255); + audio_setvolume(AUDIO_MASTER, vol); audio_setvolume(AUDIO_PCM, 255); for(i=1; i 100) { + fprintf(stderr, "%s must be followed by a number 1-100\n", argv[-1]); + return 1; + } + audio_setvolume(AUDIO_DEFAULT, vol * 255 / 100); + + } else if(strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-help") == 0) { print_usage(argv[0]); return 0; } else { @@ -168,5 +175,6 @@ static void print_usage(const char *argv0) { printf("Usage: %s [options] ... \n", argv0); printf("options:\n"); + printf(" -v,-volume : set audio volume (1-100)\n"); printf(" -h,-help: print usage and exit\n"); }