diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2024-01-11 22:31:53 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2024-01-11 22:32:34 +0100 |
commit | 2dea689fa5bf00adfd36c9afb467bf75ea0be49a (patch) | |
tree | d678f1433305aa171d2785df2a3b288811d2db57 /src | |
parent | Translated using Weblate (Dutch) (diff) | |
download | nheko-2dea689fa5bf00adfd36c9afb467bf75ea0be49a.tar.xz |
Make volume control logarithmic again
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/MxcMediaProxy.cpp | 3 | ||||
-rw-r--r-- | src/ui/MxcMediaProxy.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/ui/MxcMediaProxy.cpp b/src/ui/MxcMediaProxy.cpp index 4127121b..39fdb155 100644 --- a/src/ui/MxcMediaProxy.cpp +++ b/src/ui/MxcMediaProxy.cpp @@ -43,7 +43,8 @@ MxcMediaProxy::MxcMediaProxy(QObject *parent) nhlog::ui()->debug("Set audio output"); auto newOut = new QAudioOutput(this); newOut->setMuted(muted_); - newOut->setVolume(volume_); + newOut->setVolume(QAudio::convertVolume( + volume_, QAudio::LogarithmicVolumeScale, QAudio::LinearVolumeScale)); setAudioOutput(newOut); } }); diff --git a/src/ui/MxcMediaProxy.h b/src/ui/MxcMediaProxy.h index 2e8b2fa1..15606d36 100644 --- a/src/ui/MxcMediaProxy.h +++ b/src/ui/MxcMediaProxy.h @@ -59,7 +59,8 @@ public: { volume_ = val; if (auto output = audioOutput()) { - output->setVolume(val); + output->setVolume(QAudio::convertVolume( + val, QAudio::LogarithmicVolumeScale, QAudio::LinearVolumeScale)); } emit volumeChanged(); } |