Posted by member 5575 on 2006-07-16 02:44:26 link

Hmmm, that's funny. I use a different volume module (umslider) and still get the same exception. :\

I can set the volume to a specific level and *then* use the up and down bangs, but something goes wrong with them once you're at zero. So... I can't help you, but I can sympathize. =P

UPDATE: Ok, I think I found the problem, assuming the v_bang source is similar to the umslider source. The snippet of code looks like so:

void CVolumeControl::VolumeUp(int channel)
{
int left, right, balance;

GetVolume(channel, left, right);
if (right > left)
{
balance = 100 * left / right;
right += 655 * VOLUME_STEP;
if (right > 65535) right = 65535;
left = balance * (right / 100);
}
else
{
balance = 100 * right / left;
left += 655 * VOLUME_STEP;
if (left > 65535) left = 65535;
else
right = balance * (left / 100);
}
SetVolume(channel, left, right);
}


The volume is computed by
a) determining the balance (right/left)
b) changing the left channel volume, and then
c) multiplying left*balance to get right.

When left and right are zero, step a) causes a problem (0/0, balance not well defined). If none of the original module authors step in and fix this, I can update the code and compile a new version for you. And me. And anyone else who's been annoyed by this. =)