version 1.3, 2008/11/11 19:21:20 |
version 1.4, 2008/11/16 16:30:22 |
|
|
* parameters |
* parameters |
*/ |
*/ |
struct sock * |
struct sock * |
sock_new(struct fileops *ops, int fd, char *name) |
sock_new(struct fileops *ops, int fd, char *name, int maxweight) |
{ |
{ |
struct aproc *rproc, *wproc; |
struct aproc *rproc, *wproc; |
struct sock *f; |
struct sock *f; |
|
|
f->bufsz = 2 * dev_bufsz; |
f->bufsz = 2 * dev_bufsz; |
f->round = dev_round; |
f->round = dev_round; |
f->odelta = f->idelta = 0; |
f->odelta = f->idelta = 0; |
|
f->maxweight = maxweight; |
f->vol = ADATA_UNIT; |
f->vol = ADATA_UNIT; |
|
|
wproc = aproc_new(&wsock_ops, name); |
wproc = aproc_new(&wsock_ops, name); |
|
|
*/ |
*/ |
dev_attach(f->pipe.file.name, |
dev_attach(f->pipe.file.name, |
(f->mode & AMSG_PLAY) ? rbuf : NULL, &f->rpar, f->xrun, |
(f->mode & AMSG_PLAY) ? rbuf : NULL, &f->rpar, f->xrun, |
(f->mode & AMSG_REC) ? wbuf : NULL, &f->wpar, f->xrun); |
(f->mode & AMSG_REC) ? wbuf : NULL, &f->wpar, f->xrun, |
|
f->maxweight); |
if (f->mode & AMSG_PLAY) |
if (f->mode & AMSG_PLAY) |
dev_setvol(rbuf, f->vol); |
dev_setvol(rbuf, f->vol); |
|
|