winealsa: Implement Get/SetControlDetails

Alexandre Julliard julliard at winehq.org
Mon Apr 23 12:58:41 CDT 2007


Maarten Lankhorst <m.b.lankhorst at gmail.com> writes:

> @@ -748,6 +749,22 @@ static DWORD MIX_GetDevCaps(UINT wDevID, LPMIXERCAPS2W caps, DWORD_PTR parm2)
>      return MMSYSERR_NOERROR;
>  }
>  
> +/* convert win32 volume to alsa volume, and vice versa */
> +static DWORD normalized(long value, long prevmax, long nextmax)
> +{
> +    double ret = (double)value;
> +    ret *= (double)nextmax;
> +    ret /= (double)prevmax;
> +    ret += .5;
> +    TRACE("%ld/%ld -> %ld/%ld\n", value, prevmax, (long)ret, nextmax);
> +
> +    if (ret > nextmax)
> +        ret = nextmax;
> +    else if (ret < 0)
> +        ret = 0;
> +
> +    return (DWORD)ret;
> +}

You should probably use MulDiv() instead.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list