https://bugs.kde.org/show_bug.cgi?id=434769

Nate Graham <n...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://invent.kde.org/plas |https://invent.kde.org/plas
                   |ma/plasma-pa/commit/dedcbcc |ma/plasma-pa/commit/26994d6
                   |f753545795c0194fd98cca081e4 |7552d21ce41f641de473be2b7b3
                   |7baf70                      |509834

--- Comment #9 from Nate Graham <n...@kde.org> ---
Git commit 26994d67552d21ce41f641de473be2b7b3509834 by Nate Graham, on behalf
of Chris Holland.
Committed on 20/04/2021 at 15:42.
Pushed by ngraham into branch 'Plasma/5.21'.

Increment volume by percent instead of a constant volumeStep

Jumping by a fixed volumeStep has issues as the value is rounded.
65536/100 = 655.36
65536/100*5 = 3276.8
volumeStep = round(3276.8) = 3277

The floor() patch has an easy to test bug when jumping from 100% to
94% instead of 95% since volumeStep is rounded up.
Eg: 65536 => 62259 (-3277) 100% => 94%  (-6%)

The original round() logic also has issues when volume is around:
f(x) = (65536/100) / 2 + (65536/100) * x

amixer sset Master 983 # f(1)=983.04
Eg: 983 => 4260 (+3277) 1% => 7%  (+6%)

This patch adds changeVolumeByPercent(volumeObject, deltaPercent) to
increment any sink or source by a %volume. It also moves the common
code in increaseVolume() and decreaseVolume() into a new function.
Related: bug 435522
FIXED-IN: 5.21.5


(cherry picked from commit dedcbccf753545795c0194fd98cca081e47baf70)

M  +33   -32   applet/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-pa/commit/26994d67552d21ce41f641de473be2b7b3509834

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to