Notches for Volume Meter should match up to actual dB, and should use '-' for negative dB.

• Mar 17, 2017 - 05:40
Reported version
S4 - Minor

If I double right-click the Synthesizer volume slider, the value gets reset to 0 internally. However, the notches for the slider seem to be based on an earlier version of the code that is commented out in VolSlider::VolSlider() here

VolSlider::VolSlider(QWidget* parent)
   : Slider(parent)
//      setRange(-60.0f, 10.0f);
      setRange(-60.0f, 20.0f);

So notice that the old range is -60 to 10, while the newer range is -60 to 20. But unfortunatley the notches are still following the old commented out range. So double-right-clicking will set the internal value to 0, but it currently in 2.0.3 appears as below like it is at "10":

Screenshot (182).png

So really those notches are mislabled, since the notch where the slider is at should be the 0 notch.

Also, all the notches below 0 are negative, and so should display with a minus sign '-' in front of each number.


This is what the screen shot looks with Animeh's first commit:
Screenshot (187).png

I notice 2 small problems:
1. the "20" on top has the top of the number cut off so hard to read. It might be simplest to not bother drawing this top notch.
2. The negative numbers are too close to the red-green colored rectangle....there should at least be a pixel of space between them.

I've added comments on github.

I'd rather see the top (20) and bottom (-60) notch too, maybe moving them down, so they center with the - ?
Also they should all right-align rather then left-align

@Jojo, I was actually thinking the same thing too...if have vertically centered around the - then could fit all notches on the meter. And could have the numbers be right aligned. I didn't say that because I didn't want this issue to be too complicated because it was Animesh's second issue fix.

@Jojo, while I'm talking to you, what do you think about having an explicit '+' sign for positive dB? It is very common in audio to refer to "plus" and "minus" dB since it is a relative term to 0. So have the numbers like:

0 (right justified)

I think it looks more professional, at least.

@Jojo, there is one small problem I have with displaying a notch at the bottom of the slider, and that is that when the user moves slider all the way to bottom, the audio becomes silent. So technically if a notch was added at the bottom, it should be -∞ (negative infinity).

OK, well I could do that easily... although I originally assigned this issue to Animesh (nasehim7) to help learn how to fix issues... But now I don't know if I should just fix it myself or let Animesh do it.