23 Apr
2007
23 Apr
'07
12:58 p.m.
Maarten Lankhorst <m.b.lankhorst(a)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(a)winehq.org