Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jan 2003 10:59:45 -0800
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Daren Desjardins <desjardins@canada.com>
Cc:        freebsd-current <freebsd-current@FreeBSD.ORG>
Subject:   Re: Added volume stepping to mixer
Message-ID:  <20030106105945.A3364@FreeBSD.org>
In-Reply-To: <1041875415.294.7.camel@weed.daren.ca>; from desjardins@canada.com on Mon, Jan 06, 2003 at 12:50:15PM -0500
References:  <1041875415.294.7.camel@weed.daren.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
* De: Daren Desjardins <desjardins@canada.com> [ Data: 2003-01-06 ]
	[ Subjecte: Added volume stepping to mixer ]
> Last week I modified the mixer to support volume stepping. Having a
> keyboard with volume control on it, it has come in very handy to be able
> to use the mixer to increase/decrease the volume. I submitted the
> changes to send-pr and have an open ticket. For those that are
> interested, Im including the diff against mixer.c v1.17.

OK, I have some critiques, which if you do them (they were in my TODO
anyway) I'll be glad to commit:
	Instead of two bool's use one 'int', if it is 0, then act as
	we do now.  If it is -1, we're decreasing, if it is +1, we're
	increasing.  Thus you do something like:

	if (direction != 0)
		newvol = oldvol + (newvol * amount);
	/* Set newval */

Also, don't do what you do with printf.  What should be done, just before
setting newval (I've already done this locally, but you should as part
of what you're doing anyway) is more like this:

	if (newval < oldval)
		printf("Decreasing level to blah blah");
	else if (newval > oldval)
		printf("Increasing level to blah blah");
	else {
		printf("No change in level at blah");
		/* Get on with our lives */
	}
	/* Set newval */

Let me know.

Thanx,
juli.
-- 
Juli Mallett <jmallett@FreeBSD.org>
AIM: BSDFlata -- IRC: juli on EFnet.
OpenDarwin, Mono, FreeBSD Developer.
ircd-hybrid Developer, EFnet addict.
FreeBSD on MIPS-Anything on FreeBSD.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030106105945.A3364>