version 1.16, 2010/04/21 06:13:07 |
version 1.17, 2010/04/24 06:18:23 |
|
|
struct abuf *rbuf = NULL, *wbuf = NULL; |
struct abuf *rbuf = NULL, *wbuf = NULL; |
|
|
if (f->mode & MODE_PLAY) |
if (f->mode & MODE_PLAY) |
rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist); |
rbuf = LIST_FIRST(&f->pipe.file.rproc->outs); |
if (f->mode & MODE_RECMASK) |
if (f->mode & MODE_RECMASK) |
wbuf = LIST_FIRST(&f->pipe.file.wproc->ibuflist); |
wbuf = LIST_FIRST(&f->pipe.file.wproc->ins); |
f->pstate = WAV_RUN; |
f->pstate = WAV_RUN; |
#ifdef DEBUG |
#ifdef DEBUG |
if (debug_level >= 3) { |
if (debug_level >= 3) { |
|
|
struct abuf *rbuf = NULL, *wbuf = NULL; |
struct abuf *rbuf = NULL, *wbuf = NULL; |
|
|
if (f->mode & MODE_PLAY) |
if (f->mode & MODE_PLAY) |
rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist); |
rbuf = LIST_FIRST(&f->pipe.file.rproc->outs); |
if (f->mode & MODE_RECMASK) |
if (f->mode & MODE_RECMASK) |
wbuf = LIST_FIRST(&f->pipe.file.wproc->ibuflist); |
wbuf = LIST_FIRST(&f->pipe.file.wproc->ins); |
f->pstate = WAV_INIT; |
f->pstate = WAV_INIT; |
#ifdef DEBUG |
#ifdef DEBUG |
if (debug_level >= 3) { |
if (debug_level >= 3) { |
|
|
struct abuf *obuf; |
struct abuf *obuf; |
|
|
p = f->pipe.file.rproc; |
p = f->pipe.file.rproc; |
obuf = LIST_FIRST(&p->obuflist); |
obuf = LIST_FIRST(&p->outs); |
if (obuf == NULL) |
if (obuf == NULL) |
return 0; |
return 0; |
if (!ABUF_WOK(obuf) || !(f->pipe.file.state & FILE_ROK)) |
if (!ABUF_WOK(obuf) || !(f->pipe.file.state & FILE_ROK)) |
|
|
if (!(f->pipe.file.state & FILE_WOK)) |
if (!(f->pipe.file.state & FILE_WOK)) |
return 0; |
return 0; |
p = f->pipe.file.wproc; |
p = f->pipe.file.wproc; |
ibuf = LIST_FIRST(&p->ibuflist); |
ibuf = LIST_FIRST(&p->ins); |
if (ibuf == NULL) |
if (ibuf == NULL) |
return 0; |
return 0; |
if (!ABUF_ROK(ibuf)) |
if (!ABUF_ROK(ibuf)) |
|
|
|
|
f->vol = vol; |
f->vol = vol; |
if ((f->mode & MODE_PLAY) && f->pstate == WAV_RUN) { |
if ((f->mode & MODE_PLAY) && f->pstate == WAV_RUN) { |
rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist); |
rbuf = LIST_FIRST(&f->pipe.file.rproc->outs); |
dev_setvol(rbuf, MIDI_TO_ADATA(vol)); |
dev_setvol(rbuf, MIDI_TO_ADATA(vol)); |
} |
} |
} |
} |
|
|
|
|
if (!wav_rdata(f)) |
if (!wav_rdata(f)) |
return 0; |
return 0; |
obuf = LIST_FIRST(&p->obuflist); |
obuf = LIST_FIRST(&p->outs); |
if (obuf && f->pstate >= WAV_RUN) { |
if (obuf && f->pstate >= WAV_RUN) { |
if (!abuf_flush(obuf)) |
if (!abuf_flush(obuf)) |
return 0; |
return 0; |
|
|
int |
int |
wwav_out(struct aproc *p, struct abuf *obuf_dummy) |
wwav_out(struct aproc *p, struct abuf *obuf_dummy) |
{ |
{ |
struct abuf *ibuf = LIST_FIRST(&p->ibuflist); |
struct abuf *ibuf = LIST_FIRST(&p->ins); |
struct wav *f = (struct wav *)p->u.io.file; |
struct wav *f = (struct wav *)p->u.io.file; |
|
|
if (ibuf && f->pstate == WAV_RUN) { |
if (ibuf && f->pstate == WAV_RUN) { |