X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmain.c;h=1e17bebd9be4e09620f28b676bc1d8b68acd24da;hb=refs%2Fheads%2Fmaster;hp=107cd11ec2d460be71a7c871893e45649dd0c6cc;hpb=9a54081e387f5c08e1d1a6077283528c62509956;p=dos_auplay diff --git a/src/main.c b/src/main.c index 107cd11..1e17beb 100644 --- a/src/main.c +++ b/src/main.c @@ -12,7 +12,7 @@ static int play_file(const char *fname); static int cbfunc(void *buf, int size, void *cls); static void print_usage(const char *argv0); -static int vol = 220; +static int vol = 255; static int quit; int main(int argc, char **argv) @@ -32,7 +32,7 @@ int main(int argc, char **argv) fprintf(stderr, "%s must be followed by a number 1-100\n", argv[-1]); return 1; } - audio_setvolume(AUDIO_MASTER, vol * 255 / 100); + audio_setvolume(AUDIO_DEFAULT, vol * 255 / 100); } else if(strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-help") == 0) { print_usage(argv[0]); @@ -90,7 +90,7 @@ static int play_file(const char *fname) paused = !paused; if(paused) { audio_pause(); - printf("pause\n"); + printf("\npause\n"); } else { audio_resume(); printf("resume\n"); @@ -101,14 +101,14 @@ static int play_file(const char *fname) vol += 32; if(vol > 255) vol = 255; audio_setvolume(AUDIO_DEFAULT, vol); - printf("volume: %d%%\n", 101 * vol / 256); + printf("\nvolume: %d%%\n", 101 * vol / 256); break; case '-': vol -= 32; if(vol < 0) vol = 0; audio_setvolume(AUDIO_DEFAULT, vol); - printf("volume: %d%%\n", 101 * vol / 256); + printf("\nvolume: %d%%\n", 101 * vol / 256); break; case 'm': @@ -130,7 +130,8 @@ static int play_file(const char *fname) prev = dbg_cur_offs; _enable(); - printf("%3d%% - offs: %lu/%lu\n", 100 * prev / au->size, prev, au->size); + printf("%3d%% - offs: %lu/%lu \r", 100 * prev / au->size, prev, au->size); + fflush(stdout); } else { _enable(); } @@ -138,6 +139,7 @@ static int play_file(const char *fname) } end: + putchar('\n'); au_close(au); #ifdef DBG_PRELOAD free(dbg_samples);