Date: Sat, 17 Feb 2001 01:28:26 +0000 From: Tony Finch <dot@dotat.at> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/25156: [PATCH] Improved user-interface for mixer(8) Message-ID: <E14TwAk-0003Z0-00@hand.dotat.at>
next in thread | raw e-mail | index | archive | help
>Number: 25156
>Category: bin
>Synopsis: Improved user-interface for mixer(8)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Fri Feb 16 17:30:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Tony Finch
>Release: FreeBSD 4.2-STABLE i386
>Organization:
Covalent Technologies, Inc.
>Environment:
FreeBSD hand.dotat.at 4.2-STABLE FreeBSD 4.2-STABLE #2: Thu Feb 8 08:45:48 GMT 2001 fanf@hand.dotat.at:/FreeBSD/obj/FreeBSD/releng4/sys/DELL-Latitude-CSx i386
>Description:
A very common operation with mixer(8) is to change the overall sound
volume. At the moment you must do this with a command like "mixer vol 75";
the patch below allows you to omit the first argument in which case it
assumes "vol".
>How-To-Repeat:
>Fix:
--- /usr/src/usr.sbin/mixer/mixer.c 2000/10/26 14:39:35 1.11.2.2
+++ /usr/src/usr.sbin/mixer/mixer.c 2001/02/17 01:21:33
@@ -181,13 +181,9 @@
continue;
}
- if ((dev = res_name(*argv, devmask)) == -1) {
- warnx("unknown device: %s", *argv);
- dusage = 1;
- break;
- }
-
- switch(argc > 1 ? sscanf(argv[1], "%d:%d", &l, &r) : 0) {
+ dev = res_name(*argv, devmask);
+ switch(dev == -1 ? -sscanf(argv[0], "%d", &l) :
+ argc > 1 ? sscanf(argv[1], "%d:%d", &l, &r) : 0) {
case 0:
if (ioctl(baz, MIXER_READ(dev),&bar)== -1) {
warn("MIXER_READ");
@@ -202,6 +198,13 @@
argc--; argv++;
break;
+ case -1:
+ if ((dev = res_name("vol", devmask)) == -1) {
+ warnx("unknown device: %s", *argv);
+ dusage = 1;
+ break;
+ }
+ argc += 1; argv -= 1;
case 1:
r = l;
case 2:
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E14TwAk-0003Z0-00>
