diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2007-09-17 13:46:12 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2007-09-17 13:46:12 +0000 |
commit | c9a87457c67eeebe2671076ee823916738154936 (patch) | |
tree | 8a9d60f63d6d8a9703aba073ba50efec35cf8689 | |
parent | 5a5e765834267dc4616c8d77f26790d42cbdc4e8 (diff) |
implement the output_muted member of audio_info_t as found in original
Sun audio.
input from and ok ratchov
-rw-r--r-- | share/man/man4/audio.4 | 7 | ||||
-rw-r--r-- | sys/dev/audio.c | 10 | ||||
-rw-r--r-- | sys/sys/audioio.h | 5 | ||||
-rw-r--r-- | usr.bin/audioctl/audioctl.c | 3 |
4 files changed, 18 insertions, 7 deletions
diff --git a/share/man/man4/audio.4 b/share/man/man4/audio.4 index b2c8ba2a25f..17a46030c01 100644 --- a/share/man/man4/audio.4 +++ b/share/man/man4/audio.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: audio.4,v 1.43 2007/09/12 06:12:23 ratchov Exp $ +.\" $OpenBSD: audio.4,v 1.44 2007/09/17 13:46:11 jakemsr Exp $ .\" $NetBSD: audio.4,v 1.20 1998/05/28 17:27:15 augustss Exp $ .\" .\" Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: September 12 2007 $ +.Dd $Mdocdate: September 17 2007 $ .Dt AUDIO 4 .Os .Sh NAME @@ -311,7 +311,8 @@ typedef struct audio_info { u_int blocksize; /* H/W read/write block size */ u_int hiwat; /* output high water mark */ u_int lowat; /* output low water mark */ - u_int _ispare1; + u_char output_muted; /* toggle play mute */ + u_char cspare[3]; u_int mode; /* current device mode */ #define AUMODE_PLAY 0x01 #define AUMODE_RECORD 0x02 diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 40dc9e9ea02..7ab08aba6d5 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.77 2007/09/17 13:35:46 jakemsr Exp $ */ +/* $OpenBSD: audio.c,v 1.78 2007/09/17 13:46:11 jakemsr Exp $ */ /* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */ /* @@ -2723,6 +2723,12 @@ audiosetinfo(struct audio_softc *sc, struct audio_info *ai) return(error); } + if (ai->output_muted != (u_char)~0) { + error = au_set_mute(sc, &sc->sc_outports, ai->output_muted); + if (error) + return(error); + } + if (ai->monitor_gain != ~0 && sc->sc_monitor_port != -1) { mixer_ctrl_t ct; @@ -2877,6 +2883,8 @@ audiogetinfo(struct audio_softc *sc, struct audio_info *ai) } else ai->monitor_gain = 0; + au_get_mute(sc, &sc->sc_outports, &ai->output_muted); + p->seek = sc->sc_pr.used / sc->sc_pparams.factor; r->seek = sc->sc_rr.used / sc->sc_rparams.factor; diff --git a/sys/sys/audioio.h b/sys/sys/audioio.h index c2ab64ee4b0..07412e76218 100644 --- a/sys/sys/audioio.h +++ b/sys/sys/audioio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: audioio.h,v 1.16 2005/12/14 13:59:04 fgsch Exp $ */ +/* $OpenBSD: audioio.h,v 1.17 2007/09/17 13:46:11 jakemsr Exp $ */ /* $NetBSD: audioio.h,v 1.24 1998/08/13 06:28:41 mrg Exp $ */ /* @@ -74,7 +74,8 @@ struct audio_info { u_int blocksize; /* H/W read/write block size */ u_int hiwat; /* output high water mark */ u_int lowat; /* output low water mark */ - u_int _ispare1; + u_char output_muted; /* toggle play mute */ + u_char cspare[3]; u_int mode; /* current device mode */ #define AUMODE_PLAY 0x01 #define AUMODE_RECORD 0x02 diff --git a/usr.bin/audioctl/audioctl.c b/usr.bin/audioctl/audioctl.c index 10faad0ad4a..80fcc5fbd2f 100644 --- a/usr.bin/audioctl/audioctl.c +++ b/usr.bin/audioctl/audioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audioctl.c,v 1.13 2007/08/06 19:16:06 sobrado Exp $ */ +/* $OpenBSD: audioctl.c,v 1.14 2007/09/17 13:46:11 jakemsr Exp $ */ /* $NetBSD: audioctl.c,v 1.14 1998/04/27 16:55:23 augustss Exp $ */ /* @@ -96,6 +96,7 @@ struct field { { "blocksize", &info.blocksize, UINT, 0 }, { "hiwat", &info.hiwat, UINT, 0 }, { "lowat", &info.lowat, UINT, 0 }, + { "output_muted", &info.output_muted, UCHAR, 0 }, { "monitor_gain", &info.monitor_gain, UINT, 0 }, { "mode", &info.mode, P_R, READONLY }, { "play.rate", &info.play.sample_rate, UINT, 0 }, |