diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-04-03 17:40:34 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-04-03 17:40:34 +0000 |
commit | 1f1e75a96689e478cf3357f495812c131cb352f9 (patch) | |
tree | 4c0138208ad43819ad172abac04aa95589e6b6e9 /usr.bin/aucat/opt.c | |
parent | 148d5c4d2674e507ae720da1aa37065cf06a01db (diff) |
doc fixes from jmc
Diffstat (limited to 'usr.bin/aucat/opt.c')
-rw-r--r-- | usr.bin/aucat/opt.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/usr.bin/aucat/opt.c b/usr.bin/aucat/opt.c index 3c7e8959765..c4fd6e6c3c1 100644 --- a/usr.bin/aucat/opt.c +++ b/usr.bin/aucat/opt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: opt.c,v 1.4 2010/01/10 21:47:41 ratchov Exp $ */ +/* $OpenBSD: opt.c,v 1.5 2010/04/03 17:40:33 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -27,8 +27,8 @@ struct optlist opt_list = SLIST_HEAD_INITIALIZER(&opt_list); void -opt_new(char *name, - struct aparams *wpar, struct aparams *rpar, int maxweight, int mmc) +opt_new(char *name, struct aparams *wpar, struct aparams *rpar, + int maxweight, int mmc, unsigned mode) { struct opt *o; unsigned len; @@ -54,21 +54,39 @@ opt_new(char *name, exit(1); } memcpy(o->name, name, len + 1); - o->wpar = *wpar; - o->rpar = *rpar; + if (mode & MODE_RECMASK) + o->wpar = (mode & MODE_MON) ? *rpar : *wpar; + if (mode & MODE_PLAY) + o->rpar = *rpar; o->maxweight = maxweight; o->mmc = mmc; + o->mode = mode; #ifdef DEBUG if (debug_level >= 2) { dbg_puts(o->name); - dbg_puts(": rec "); - aparams_dbg(&o->wpar); - dbg_puts(", play "); - aparams_dbg(&o->rpar); - dbg_puts(", vol "); - dbg_putu(o->maxweight); + dbg_puts(":"); + if (mode & MODE_REC) { + dbg_puts(" rec="); + dbg_putu(o->wpar.cmin); + dbg_puts(":"); + dbg_putu(o->wpar.cmax); + } + if (mode & MODE_PLAY) { + dbg_puts(" play="); + dbg_putu(o->rpar.cmin); + dbg_puts(":"); + dbg_putu(o->rpar.cmax); + dbg_puts(" vol="); + dbg_putu(o->maxweight); + } + if (mode & MODE_MON) { + dbg_puts(" mon="); + dbg_putu(o->wpar.cmin); + dbg_puts(":"); + dbg_putu(o->wpar.cmax); + } if (o->mmc) - dbg_puts(", mmc"); + dbg_puts(" mmc"); dbg_puts("\n"); } #endif |