summaryrefslogtreecommitdiff
path: root/sys/dev/audio.c
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2007-03-01 17:31:35 +0000
committerthorpej <thorpej@NetBSD.org>2007-03-01 17:31:35 +0000
commitebd626809e4030dffa64b719e06a2dabe0917265 (patch)
tree164128c2ca33dff2d1a023fbbcec638a47b95a9a /sys/dev/audio.c
parent793e6a8c0a209df5218ee807651db7eb15d22c58 (diff)
TRUE -> true, FALSE -> false
Diffstat (limited to 'sys/dev/audio.c')
-rw-r--r--sys/dev/audio.c108
1 files changed, 54 insertions, 54 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 0625e85cf66..1f7f96c739c 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.218 2007/02/21 22:59:58 thorpej Exp $ */
+/* $NetBSD: audio.c,v 1.219 2007/03/01 17:31:35 thorpej Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.218 2007/02/21 22:59:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.219 2007/03/01 17:31:35 thorpej Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -345,17 +345,17 @@ audioattach(struct device *parent, struct device *self, void *aux)
sc->sc_inports.index = -1;
sc->sc_inports.master = -1;
sc->sc_inports.nports = 0;
- sc->sc_inports.isenum = FALSE;
+ sc->sc_inports.isenum = false;
sc->sc_inports.allports = 0;
- sc->sc_inports.isdual = FALSE;
+ sc->sc_inports.isdual = false;
sc->sc_inports.mixerout = -1;
sc->sc_inports.cur_port = -1;
sc->sc_outports.index = -1;
sc->sc_outports.master = -1;
sc->sc_outports.nports = 0;
- sc->sc_outports.isenum = FALSE;
+ sc->sc_outports.isenum = false;
sc->sc_outports.allports = 0;
- sc->sc_outports.isdual = FALSE;
+ sc->sc_outports.isdual = false;
sc->sc_outports.mixerout = -1;
sc->sc_outports.cur_port = -1;
sc->sc_monitor_port = -1;
@@ -482,7 +482,7 @@ audioactivate(struct device *self, enum devact act)
return EOPNOTSUPP;
case DVACT_DEACTIVATE:
- sc->sc_dying = TRUE;
+ sc->sc_dying = true;
break;
}
return 0;
@@ -498,7 +498,7 @@ audiodetach(struct device *self, int flags)
sc = (struct audio_softc *)self;
DPRINTF(("audio_detach: sc=%p flags=%d\n", sc, flags));
- sc->sc_dying = TRUE;
+ sc->sc_dying = true;
wakeup(&sc->sc_wchan);
wakeup(&sc->sc_rchan);
@@ -563,7 +563,7 @@ au_setup_ports(struct audio_softc *sc, struct au_mixer_ports *ports,
ports->index = mi->index;
if (mi->type == AUDIO_MIXER_ENUM) {
- ports->isenum = TRUE;
+ ports->isenum = true;
for(i = 0; tbl[i].name; i++)
for(j = 0; j < mi->un.e.num_mem; j++)
if (strcmp(mi->un.e.member[j].label.name,
@@ -577,7 +577,7 @@ au_setup_ports(struct audio_softc *sc, struct au_mixer_ports *ports,
mi->mixer_class);
if (ports->mixerout != -1 &&
ports->miport[ports->nports++] != -1)
- ports->isdual = TRUE;
+ ports->isdual = true;
}
} else if (mi->type == AUDIO_MIXER_SET) {
for(i = 0; tbl[i].name; i++)
@@ -876,7 +876,7 @@ audio_stream_ctor(audio_stream_t *stream, const audio_params_t *param, int size)
stream->outp = stream->start;
stream->used = 0;
stream->param = *param;
- stream->loop = FALSE;
+ stream->loop = false;
return 0;
}
@@ -1214,10 +1214,10 @@ audio_init_ringbuffer(struct audio_softc *sc, struct audio_ringbuffer *rp,
rp->stamp_last = 0;
rp->fstamp = 0;
rp->drops = 0;
- rp->pause = FALSE;
- rp->copying = FALSE;
- rp->needfill = FALSE;
- rp->mmapped = FALSE;
+ rp->pause = false;
+ rp->copying = false;
+ rp->needfill = false;
+ rp->mmapped = false;
}
int
@@ -1356,8 +1356,8 @@ audio_open(dev_t dev, struct audio_softc *sc, int flags, int ifmt,
sc->sc_rchan = 0;
sc->sc_wchan = 0;
sc->sc_sil_count = 0;
- sc->sc_rbus = FALSE;
- sc->sc_pbus = FALSE;
+ sc->sc_rbus = false;
+ sc->sc_pbus = false;
sc->sc_eof = 0;
sc->sc_playdrop = 0;
@@ -1496,7 +1496,7 @@ audio_drain(struct audio_softc *sc)
#ifdef DIAGNOSTIC
if (cb->copying) {
printf("audio_drain: copying in progress!?!\n");
- cb->copying = FALSE;
+ cb->copying = false;
}
#endif
drops = cb->drops;
@@ -1541,7 +1541,7 @@ audio_close(struct audio_softc *sc, int flags, int ifmt,
*/
if (!sc->sc_full_duplex || hw->halt_input != hw->halt_output)
hw->halt_input(sc->hw_hdl);
- sc->sc_rbus = FALSE;
+ sc->sc_rbus = false;
}
/*
* Block until output drains, but allow ^C interrupt.
@@ -1555,7 +1555,7 @@ audio_close(struct audio_softc *sc, int flags, int ifmt,
if (!sc->sc_pr.pause && !audio_drain(sc) && hw->drain)
(void)hw->drain(sc->hw_hdl);
hw->halt_output(sc->hw_hdl);
- sc->sc_pbus = FALSE;
+ sc->sc_pbus = false;
}
if (hw->close != NULL)
@@ -1650,7 +1650,7 @@ audio_read(struct audio_softc *sc, struct uio *uio, int ioflag)
outp = sc->sc_rustream->outp;
inp = sc->sc_rustream->inp;
- cb->copying = TRUE;
+ cb->copying = true;
splx(s);
/*
@@ -1667,7 +1667,7 @@ audio_read(struct audio_softc *sc, struct uio *uio, int ioflag)
s = splaudio();
sc->sc_rustream->outp = audio_stream_add_outp
(sc->sc_rustream, outp, n);
- cb->copying = FALSE;
+ cb->copying = false;
splx(s);
}
return error;
@@ -1682,12 +1682,12 @@ audio_clear(struct audio_softc *sc)
if (sc->sc_rbus) {
audio_wakeup(&sc->sc_rchan);
sc->hw_if->halt_input(sc->hw_hdl);
- sc->sc_rbus = FALSE;
+ sc->sc_rbus = false;
}
if (sc->sc_pbus) {
audio_wakeup(&sc->sc_wchan);
sc->hw_if->halt_output(sc->hw_hdl);
- sc->sc_pbus = FALSE;
+ sc->sc_pbus = false;
}
splx(s);
}
@@ -1932,7 +1932,7 @@ audio_write(struct audio_softc *sc, struct uio *uio, int ioflag)
}
}
inp = cb->s.inp;
- cb->copying = TRUE;
+ cb->copying = true;
stream = cb->s;
used = stream.used;
splx(s);
@@ -1994,8 +1994,8 @@ audio_write(struct audio_softc *sc, struct uio *uio, int ioflag)
DPRINTF(("audio_write: partial fill %d\n", cc));
} else
cc = 0;
- cb->needfill = FALSE;
- cb->copying = FALSE;
+ cb->needfill = false;
+ cb->copying = false;
if (!sc->sc_pbus && !cb->pause) {
saveerror = error;
error = audiostartp(sc);
@@ -2376,7 +2376,7 @@ audio_mmap(struct audio_softc *sc, off_t off, int prot)
if ((u_int)off >= cb->s.bufsize)
return -1;
if (!cb->mmapped) {
- cb->mmapped = TRUE;
+ cb->mmapped = true;
if (cb == &sc->sc_pr) {
audio_fill_silence(&cb->s.param, cb->s.start,
cb->s.bufsize);
@@ -2417,7 +2417,7 @@ audiostartr(struct audio_softc *sc)
DPRINTF(("audiostartr failed: %d\n", error));
return error;
}
- sc->sc_rbus = TRUE;
+ sc->sc_rbus = true;
return 0;
}
@@ -2453,7 +2453,7 @@ audiostartp(struct audio_softc *sc)
DPRINTF(("audiostartp failed: %d\n", error));
return error;
}
- sc->sc_pbus = TRUE;
+ sc->sc_pbus = true;
return 0;
}
@@ -2637,7 +2637,7 @@ audio_pint(void *v)
/* we don't have a full block to use */
if (cb->copying) {
/* writer is in progress, don't disturb */
- cb->needfill = TRUE;
+ cb->needfill = true;
DPRINTFN(1, ("audio_pint: copying in progress\n"));
} else {
inp = cb->s.inp;
@@ -2867,7 +2867,7 @@ audio_set_defaults(struct audio_softc *sc, u_int mode)
/* default parameters */
sc->sc_rparams = audio_default;
sc->sc_pparams = audio_default;
- sc->sc_blkset = FALSE;
+ sc->sc_blkset = false;
AUDIO_INITINFO(&ai);
ai.record.sample_rate = sc->sc_rparams.sample_rate;
@@ -3193,9 +3193,9 @@ audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
rbus = sc->sc_rbus;
pbus = sc->sc_pbus;
error = 0;
- cleared = FALSE;
- modechange = FALSE;
- pausechange = FALSE;
+ cleared = false;
+ modechange = false;
+ pausechange = false;
pp = sc->sc_pparams; /* Temporary encoding storage in */
rp = sc->sc_rparams; /* case setting the modes fails. */
@@ -3255,26 +3255,26 @@ audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
if (nr > 0) {
if (!cleared) {
audio_clear(sc);
- cleared = TRUE;
+ cleared = true;
}
- modechange = TRUE;
+ modechange = true;
setmode |= AUMODE_RECORD;
}
if (np > 0) {
if (!cleared) {
audio_clear(sc);
- cleared = TRUE;
+ cleared = true;
}
- modechange = TRUE;
+ modechange = true;
setmode |= AUMODE_PLAY;
}
if (SPECIFIED(ai->mode)) {
if (!cleared) {
audio_clear(sc);
- cleared = TRUE;
+ cleared = true;
}
- modechange = TRUE;
+ modechange = true;
sc->sc_mode = ai->mode;
if (sc->sc_mode & AUMODE_PLAY_ALL)
sc->sc_mode |= AUMODE_PLAY;
@@ -3366,7 +3366,7 @@ audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
if (SPECIFIED(p->port)) {
if (!cleared) {
audio_clear(sc);
- cleared = TRUE;
+ cleared = true;
}
error = au_set_port(sc, &sc->sc_outports, p->port);
if (error)
@@ -3375,7 +3375,7 @@ audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
if (SPECIFIED(r->port)) {
if (!cleared) {
audio_clear(sc);
- cleared = TRUE;
+ cleared = true;
}
error = au_set_port(sc, &sc->sc_inports, r->port);
if (error)
@@ -3422,12 +3422,12 @@ audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
if (SPECIFIED_CH(p->pause)) {
sc->sc_pr.pause = p->pause;
pbus = !p->pause;
- pausechange = TRUE;
+ pausechange = true;
}
if (SPECIFIED_CH(r->pause)) {
sc->sc_rr.pause = r->pause;
rbus = !r->pause;
- pausechange = TRUE;
+ pausechange = true;
}
if (SPECIFIED(ai->blocksize)) {
@@ -3437,18 +3437,18 @@ audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
if (ai->blocksize == 0) {
if (!cleared) {
audio_clear(sc);
- cleared = TRUE;
+ cleared = true;
}
- sc->sc_blkset = FALSE;
+ sc->sc_blkset = false;
audio_calc_blksize(sc, AUMODE_RECORD);
audio_calc_blksize(sc, AUMODE_PLAY);
} else {
- sc->sc_blkset = TRUE;
+ sc->sc_blkset = true;
/* check whether new blocksize changes actually */
if (hw->round_blocksize == NULL) {
if (!cleared) {
audio_clear(sc);
- cleared = TRUE;
+ cleared = true;
}
sc->sc_pr.blksize = ai->blocksize;
sc->sc_rr.blksize = ai->blocksize;
@@ -3461,7 +3461,7 @@ audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
rblksize != sc->sc_rr.blksize) {
if (!cleared) {
audio_clear(sc);
- cleared = TRUE;
+ cleared = true;
}
sc->sc_pr.blksize = ai->blocksize;
sc->sc_rr.blksize = ai->blocksize;
@@ -3801,15 +3801,15 @@ audio_powerhook(int why, void *aux)
switch (why) {
case PWR_SOFTSUSPEND:
- if (sc->sc_pbus == TRUE)
+ if (sc->sc_pbus == true)
hwp->halt_output(sc->hw_hdl);
- if (sc->sc_rbus == TRUE)
+ if (sc->sc_rbus == true)
hwp->halt_input(sc->hw_hdl);
break;
case PWR_SOFTRESUME:
- if (sc->sc_pbus == TRUE)
+ if (sc->sc_pbus == true)
audiostartp(sc);
- if (sc->sc_rbus == TRUE)
+ if (sc->sc_rbus == true)
audiostartr(sc);
break;
}