Maarten Lankhorst m.b.lankhorst@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.