* De: Daren Desjardins <[EMAIL PROTECTED]> [ 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 <[EMAIL PROTECTED]>
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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to