mixer

FreeBSD OSS mixer library implementation and a complete rewrite of mixer(8)
git clone git://git.margiolis.net/mixer.git
Log | Files | Refs | README | LICENSE

commit 63a9dbfa21b89205b9ee0f43e4c8374f81535aae
parent c6b4ee6293ac7e9e143de75010f8749190db604a
Author: Christos Margiolis <christos@margiolis.net>
Date:   Sun, 20 Mar 2022 18:28:26 +0200

accept floats, move defines to enum

Diffstat:
Musr.sbin/mixer/mixer.c | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c @@ -30,9 +30,11 @@ #include <string.h> #include <unistd.h> -#define C_VOL 0 -#define C_MUT 1 -#define C_SRC 2 +enum { + C_VOL = 0, + C_MUT, + C_SRC, +}; static void usage(void) __dead2; static void initctls(struct mixer *); @@ -147,7 +149,7 @@ parse: pall = 0; goto next; } else { - for (q = p; *q >= '0' && *q <= '9'; q++) + for (q = p; (*q >= '0' && *q <= '9') || *q == '.'; q++) ; /* nothing */ /* Input: `dev=N` -> shorthand for `dev.volume=N`. */ if (*q == '\0') {