diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2011-05-26 07:18:41 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2011-05-26 07:18:41 +0000 |
commit | a76b2bb9ddd43569d8335eebb3456d6c60b492b1 (patch) | |
tree | bd505c211598839a0f6c7176ad7b9010ab13c4bb /usr.bin/aucat/aucat.c | |
parent | 28c2975d6c806b1333060e08ee056c3c477bd214 (diff) |
add a new -w flag to control whether master volume is automatically
adjusted when new streams are connected and disconnected. Disabling
automatic volume adjustment makes sense if all streams are recorded
with properly lowered volumes.
Diffstat (limited to 'usr.bin/aucat/aucat.c')
-rw-r--r-- | usr.bin/aucat/aucat.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c index 87618c9cbba..ae3d916237f 100644 --- a/usr.bin/aucat/aucat.c +++ b/usr.bin/aucat/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.114 2011/05/10 06:26:34 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.115 2011/05/26 07:18:40 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -250,6 +250,7 @@ struct cfdev { struct aparams ipar; /* input (read) parameters */ struct aparams opar; /* output (write) parameters */ unsigned hold; /* open immediately */ + unsigned autovol; /* adjust volumes */ unsigned bufsz; /* par.bufsz for sio device */ unsigned round; /* par.round for sio device */ unsigned mode; /* bitmap of MODE_XXX */ @@ -442,7 +443,7 @@ aucat_usage(void) "[-o file]\n\t" "[-q device] [-r rate] [-s name] [-t mode] [-U unit] " "[-v volume]\n\t" - "[-x policy] [-z nframes]\n", + "[-w flag] [-x policy] [-z nframes]\n", stderr); } @@ -511,8 +512,9 @@ aucat_main(int argc, char **argv) cd->bufsz = 0; cd->round = 0; cd->hold = 1; + cd->autovol = 1; - while ((c = getopt(argc, argv, "a:dnb:c:C:e:r:h:x:v:i:o:f:m:luq:s:U:L:t:j:z:")) != -1) { + while ((c = getopt(argc, argv, "a:w:dnb:c:C:e:r:h:x:v:i:o:f:m:luq:s:U:L:t:j:z:")) != -1) { switch (c) { case 'd': #ifdef DEBUG @@ -592,6 +594,9 @@ aucat_main(int argc, char **argv) case 'a': cd->hold = opt_onoff(); break; + case 'w': + cd->autovol = opt_onoff(); + break; case 'q': cfmid_add(&cd->mids, optarg); break; @@ -730,7 +735,7 @@ aucat_main(int argc, char **argv) } else { d = dev_new_sio(cd->path, cd->mode | MODE_MIDIMASK, &cd->ipar, &cd->opar, cd->bufsz, cd->round, - cd->hold); + cd->hold, cd->autovol); } if (d == NULL) errx(1, "%s: can't open device", cd->path); |