Amarok + PulseAudio: volume control changes global volume

Christian Esken esken at kde.org
Wed Jul 7 00:39:01 BST 2010


Am Dienstag, 6. Juli 2010, 16:43:28 schrieb Colin Guthrie:

> In actual fact, for this reason, PA makes finding the 0dB point easier
> than with plain alsa as it clearly presents the 0dB in the pavucontrol
> GUI as "Base Volume". Some cards have 0dB == 100% in which case the base
> volume isn't shown, but on some cards, 12dB == 100% so 0dB is somewhere
> around the 70% mark (depends how you convert your dB -> % tho'). So we
> clearly mark the base volume in the GUI so users know exactly where to
> put their sliders to avoid software attenuation.
> 
> Described a little better here:
> http://pulseaudio.org/wiki/WritingVolumeControlUIs#Colouredvolumesliders
> 
> I've not yet had time to try and work out how to show the base volume in
> kmix, but it'll come eventually.

Probably you could derive from QSlider and then do some background coloring in 
paintEvent() before calling QSlider::paintEvent(). But I am not sure whether 
one can abstract from the different slider looks for doing precise painting. 

Or you would have to do your complete own slider. A nice starting point could 
be the KSmallSlider class. Though unused, it is still working - I found that 
out in Randa by accidentally passing the "small" flag to the method.

KSmallSlider is already colored (color gradient), and a cool thing to add 
would be to have a feature like snap-in points, e.g. at 0dB.


By the way. As we are talking about coloring, I have finally implemented the
background colorization of controls (Wish 57952 on b.k.o). That feature was 
there "near complete" in KDE4.0, but finally I have implemented it. Strangely 
enough, the 	tickmarks get colored, instead of the background, even  though I 
use QPalette::Window :

---  code snippet from Branch branches/work/kmix, mdwslider.cpp line 515 ---
 QPalette qpal = sliderBig->palette();
 qpal.setColor(QPalette::Window, qcol);
 sliderBig->setPalette(qpal);
--- end ----------------------------------

If anyone has an idea here, I'll be very glad.

Greetings,
     Christian



More information about the kde-multimedia mailing list