Commit 3279cc8c authored by Christian Esken's avatar Christian Esken
Browse files

Implement optional Pulseaudio volume overdrive (PA_VOLUME_UI_MAX).

CCBUGS: 297959
parent 50cbcd83
......@@ -575,6 +575,7 @@ KMixWindow::loadBaseConfig()
"Modem");
MixerToolBox::instance()->setMixerIgnoreExpression(mixerIgnoreExpression);
// --- Advanced options, without GUI: START -------------------------------------
QString volumePercentageStepString = config.readEntry("VolumePercentageStep");
if (!volumePercentageStepString.isNull())
{
......@@ -583,9 +584,12 @@ KMixWindow::loadBaseConfig()
Mixer::VOLUME_STEP_DIVISOR = (100 / volumePercentageStep);
}
GlobalConfig::instance().volumeOverdrive = config.readEntry("VolumeOverdrive", false);
// --- Advanced options, without GUI: END -------------------------------------
m_backendFilter = config.readEntry<>("Backends", QList<QString>());
kDebug()
<< "Backends: " << m_backendFilter;
kDebug() << "Backends: " << m_backendFilter;
if (orientationString == "Horizontal")
GlobalConfig::instance().toplevelOrientation = Qt::Horizontal;
......
......@@ -29,6 +29,7 @@
#include "core/mixer.h"
#include "core/ControlManager.h"
#include "core/GlobalConfig.h"
#include <pulse/glib-mainloop.h>
#include <pulse/ext-stream-restore.h>
......@@ -827,7 +828,8 @@ void Mixer_PULSE::addDevice(devinfo& dev, bool isAppStream)
else if (m_devnum == KMIXPA_APP_CAPTURE && s_mixers.contains(KMIXPA_CAPTURE))
ms = s_mixers[KMIXPA_CAPTURE]->getMixSet();
Volume v(PA_VOLUME_NORM, PA_VOLUME_MUTED, true, false);
int maxVol = GlobalConfig::instance().volumeOverdrive ? PA_VOLUME_UI_MAX : PA_VOLUME_NORM;
Volume v(maxVol, PA_VOLUME_MUTED, true, false);
v.addVolumeChannels(dev.chanMask);
setVolumeFromPulse(v, dev);
MixDevice* md = new MixDevice( _mixer, dev.name, dev.description, dev.icon_name, ms);
......
......@@ -37,6 +37,8 @@ public:
static GlobalConfig& instance() { return instanceObj; };
bool volumeOverdrive; // whether more than recommended volume (typically 0dB) is allowed
protected:
QSet<QString> mixersForSoundmenu;
......@@ -49,6 +51,7 @@ private:
showOSD = true;
toplevelOrientation = Qt::Vertical;
traypopupOrientation = Qt::Vertical;
volumeOverdrive = false;
};
static GlobalConfig instanceObj;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment