summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/wav.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-04-21 06:13:08 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-04-21 06:13:08 +0000
commitefc14258154a1bf6f835d62a9157c3a37d44e005 (patch)
tree3a6ee7f82616a927a43ddcd4c34eb53192eaa765 /usr.bin/aucat/wav.c
parentd8c97c7d4206ddd1bf3d1bd630df8b8552e4fd86 (diff)
adds the necessary bits to join channels (ex stereo->mono) or
expand channels (ex mono->stereo). It's switched on/off with the ``-j'' option, (default is "on").
Diffstat (limited to 'usr.bin/aucat/wav.c')
-rw-r--r--usr.bin/aucat/wav.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/aucat/wav.c b/usr.bin/aucat/wav.c
index af7a3de9982..2583b3bb6c5 100644
--- a/usr.bin/aucat/wav.c
+++ b/usr.bin/aucat/wav.c
@@ -318,7 +318,9 @@ wav_attach(struct wav *f, int force)
}
#endif
dev_attach(f->pipe.file.name, f->mode,
- rbuf, &f->hpar, wbuf, &f->hpar, f->xrun, f->maxweight);
+ rbuf, &f->hpar, f->join ? dev_opar.cmax - dev_opar.cmin + 1 : 0,
+ wbuf, &f->hpar, f->join ? dev_ipar.cmax - dev_ipar.cmin + 1 : 0,
+ f->xrun, f->maxweight);
if (f->mode & MODE_PLAY)
dev_setvol(rbuf, MIDI_TO_ADATA(f->vol));
return 1;
@@ -628,7 +630,7 @@ wav_locreq(void *arg, unsigned mmc)
*/
struct wav *
wav_new_in(struct fileops *ops, unsigned mode, char *name, unsigned hdr,
- struct aparams *par, unsigned xrun, unsigned volctl, int tr)
+ struct aparams *par, unsigned xrun, unsigned volctl, int tr, int join)
{
int fd;
struct wav *f;
@@ -668,6 +670,7 @@ wav_new_in(struct fileops *ops, unsigned mode, char *name, unsigned hdr,
f->map = NULL;
}
f->tr = tr;
+ f->join = join;
f->mode = mode;
f->hpar = *par;
f->hdr = 0;
@@ -698,7 +701,7 @@ wav_new_in(struct fileops *ops, unsigned mode, char *name, unsigned hdr,
*/
struct wav *
wav_new_out(struct fileops *ops, unsigned mode, char *name, unsigned hdr,
- struct aparams *par, unsigned xrun, int tr)
+ struct aparams *par, unsigned xrun, int tr, int join)
{
int fd;
struct wav *f;
@@ -734,6 +737,7 @@ wav_new_out(struct fileops *ops, unsigned mode, char *name, unsigned hdr,
f->startpos = f->endpos = 0;
}
f->tr = tr;
+ f->join = join;
f->mode = mode;
f->hpar = *par;
f->hdr = hdr;