Date: Mon, 9 Aug 1999 01:05:55 +0200 (CEST) From: Oliver Fromme <olli@dorifer.heim3.tu-clausthal.de> To: freebsd-hackers@FreeBSD.ORG Subject: Re: rc addition proposal: mixer Message-ID: <199908082305.BAA07652@dorifer.heim3.tu-clausthal.de>
index | next in thread | raw e-mail
Brian F. Feldman wrote in list.freebsd-hackers:
> I envision something like the following being available in /etc/rc,
> since there are many people who set mixer default values at startup in
> some random way. It would be nice to provide an easy way to do this.
> I'd like to get a vote on whether this should be added or not.
>
> I'd do something like the following:
>
> if [ -n "$mixer_device" ]; do
> mixer="mixer -f $mixer_device"
> else
> mixer="mixer"
> done
> for cf in `$mixer | cut -d' ' -f2` recsrc; do
> if eval [ -n "mixer_$cf" ]; then
> eval \$mixer \$cf \$mixer_$cf
> fi
> done
I'd like to propose a different approach. This is a slight
modification of what I do on my own boxes (using a script in
/usr/local/etc/rc.d).
rc.conf (example):
mixer_enable="YES" # (default = NO)
mixer_config="/etc/mixer.conf" # (default)
mixer_device="/dev/mixer" # (default)
mixer.conf (example):
# some comment
vol 90
synth 50 # more comments...
bass 75
treble 50
mic 0
line 50
cd 80
speaker 0
igain 50
ogain 70
rc:
if [ "X${mixer_enable}" != X"NO" -a -f "${mixer_config}" ]; then
echo -n ' mixer'
slots=`mixer -f ${mixer_device} | cut -d' ' -f2 | tr '\n' '|'`recsrc
sed 's/#.*$//' ${mixer_config} | egrep "$slots" | xargs mixer -f ${mixer_device}
fi
Just my 0.02 Euro...
Regards
Oliver
--
Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany
(Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de)
"In jedem Stück Kohle wartet ein Diamant auf seine Geburt"
(Terry Pratchett)
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908082305.BAA07652>
