[haiku-development] Re: Sound of Silence...

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 02 Jun 2009 10:26:41 +0200 CEST

pete.goodeve@xxxxxxxxxxxx wrote:
> I have been digging into sources a bit, though, and I believe I've 
> found
> the reason for my red volume slider...  And unless I'm going mad, 
> everyone
> else should be seeing it too!
> 
> On line 304 of .../src/bin/desklink/VolumeControl.cpp, I see:
> 
>  float position = 1.0f * (max - min - max) / (max - min);
> 
> Hunh...?  Doesn't this result in a *negative* position for all min 
> and max?
> As that position is then fed to the bar drawing...:
> 
>   be_control_look->DrawSliderBar(view, frame, frame, base, 
> leftFillColor,
>                         rightFillColor, position, flags, 
> Orientation());

The position computation is only correct (even if it could be 
simplified) if "min" is negative - which is the whole point of the red 
vs. green color, anyway. The volume currently goes from -60 to +18 dB, 
btw.

Bye,
   Axel.


Other related posts: