Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Amarok
Commits
efb7ffe3
Commit
efb7ffe3
authored
Sep 19, 2013
by
Mark Kretschmann
Committed by
Vedant Agarwala
Nov 07, 2013
Browse files
Hide preamp in EQ when Phonon backend does not support it.
Prevents some confusion. BUG: 324976
parent
2f01af3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/EngineController.cpp
View file @
efb7ffe3
...
...
@@ -156,7 +156,7 @@ EngineController::initializePhonon()
// Add an equalizer effect if available
QList
<
EffectDescription
>
effects
=
BackendCapabilities
::
availableAudioEffects
();
QRegExp
equalizerRegExp
(
QString
(
"equalizer.*%1.*bands"
).
arg
(
s_equalizerBands
Count
),
QRegExp
equalizerRegExp
(
QString
(
"equalizer.*%1.*bands"
).
arg
(
s_equalizerBands
Num
),
Qt
::
CaseInsensitive
);
foreach
(
const
EffectDescription
&
description
,
effects
)
{
...
...
@@ -165,7 +165,7 @@ EngineController::initializePhonon()
QScopedPointer
<
Effect
>
equalizer
(
new
Effect
(
description
,
this
)
);
int
parameterCount
=
equalizer
->
parameters
().
count
();
if
(
parameterCount
==
s_equalizerBands
Count
||
parameterCount
==
s_equalizerBands
Count
+
1
)
if
(
parameterCount
==
s_equalizerBands
Num
||
parameterCount
==
s_equalizerBands
Num
+
1
)
{
debug
()
<<
"Established Phonon equalizer effect with"
<<
parameterCount
<<
"parameters."
;
...
...
@@ -884,7 +884,7 @@ EngineController::eqUpdate() //SLOT
QListIterator
<
int
>
equalizerParametersIt
(
equalizerParametersCfg
);
double
scaledVal
;
// Scaled value to set from universal -100 - 100 range to plugin scale
// Checking if preamp is present in equalizer parameters
if
(
equalizerParameters
.
size
()
==
s_equalizerBands
Count
)
if
(
equalizerParameters
.
size
()
==
s_equalizerBands
Num
)
{
// If pre-amp is not present then skip the first element of equalizer gain
if
(
equalizerParametersIt
.
hasNext
()
)
...
...
src/EngineController.h
View file @
efb7ffe3
...
...
@@ -40,7 +40,7 @@
#include <Phonon/EffectParameter>
#include <phonon/audiodataoutput.h>
static
const
int
s_equalizerBands
Count
=
10
;
// Number of equalizer parameters excluding Preamp
static
const
int
s_equalizerBands
Num
=
10
;
// Number of equalizer parameters excluding Preamp
class
Fadeouter
;
namespace
Capabilities
{
class
MultiPlayableCapability
;
class
MultiSourceCapability
;
}
...
...
src/dialogs/EqualizerDialog.cpp
View file @
efb7ffe3
...
...
@@ -89,16 +89,21 @@ EqualizerDialog::EqualizerDialog( QWidget* parent )
// Ask engine for maximum gain value and compute scale to display values
mValueScale
=
The
::
engineController
()
->
eqMaxGain
();
QString
mlblText
=
i18n
(
"%0
\n
dB"
).
arg
(
QString
::
number
(
mValueScale
,
'f'
,
1
)
);
const
QString
mlblText
=
i18n
(
"%0
\n
dB"
).
arg
(
QString
::
number
(
mValueScale
,
'f'
,
1
)
);
eqMaxEq
->
setText
(
QString
(
"+"
)
+
mlblText
);
eqMinEq
->
setText
(
QString
(
"-"
)
+
mlblText
);
// Ask engine for band frequencies and set labels
QStringList
equalizerBandFreq
=
The
::
engineController
()
->
eqBandsFreq
();
const
QStringList
equalizerBandFreq
=
The
::
engineController
()
->
eqBandsFreq
();
QStringListIterator
i
(
equalizerBandFreq
);
// Checking if preamp is present
if
(
equalizerBandFreq
.
size
()
==
s_equalizerBandsCount
)
eqPreampSlider
->
setDisabled
(
true
);
// Check if preamp is supported by Phonon backend
if
(
equalizerBandFreq
.
size
()
==
s_equalizerBandsNum
)
{
// Preamp not supported, so hide its slider
eqPreampLabel
->
hide
();
eqPreampSlider
->
hide
();
eqPreampValue
->
hide
();
}
else
if
(
i
.
hasNext
()
)
// If preamp is present then skip its label as it is hard-coded in UI
i
.
next
();
foreach
(
QLabel
*
mLabel
,
m_bandLabels
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment