Help - Search - Members - Calendar
Full Version: bug(?) and strange logic in volume change
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
hartwork
i added volume monitoring using

CODE
virtual void on_volume_change( int new_val )


to my plugin and analyzed the changes of new_val.

there are two cases:
(1) new_val is zero
(2) HIWORD( new_val ) is always 65535/0xFFFF, LOWORD( new_val ) seems to be in range of 55536 and X which varies each time i draw the slider to the right end!? (65396, 64526, ...)

could anybody explain this to me please?!

whatever i do with the slider i do not reach 65535.
what does the zero-case stand for?
foosion
QUOTE(play_control.h)
virtual int get_volume()=0;//volume is in 0.01 dB

So you are getting values between 0.00 dB (new_val == 0) and -100.00 dB (new_val == -10000) in on_volume_change (using the volume slider in preferences).
hartwork
thanx foosion! i didn't think of negative values (i used "%u" for output)... headbang.gif
foosion
QUOTE(hartwork @ Mar 16 2004, 11:51 PM)
i didn't think of negative values

well, the parameter type is signed integer... rolleyes.gif
hartwork
don't know why but i got used to take everything for unsigned.
so it must have been UINT to my eyes, i don't know...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.