Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
b8bdfbdb
Commit
b8bdfbdb
authored
Apr 13, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: display equalizer bands depending on the core
parent
eb19c5d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
3 deletions
+38
-3
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+36
-3
modules/gui/qt4/components/extended_panels.hpp
modules/gui/qt4/components/extended_panels.hpp
+2
-0
No files found.
modules/gui/qt4/components/extended_panels.cpp
View file @
b8bdfbdb
...
@@ -893,12 +893,18 @@ void ExtV4l2::ValueChange( int value )
...
@@ -893,12 +893,18 @@ void ExtV4l2::ValueChange( int value )
* Equalizer
* Equalizer
**********************************************************************/
**********************************************************************/
static
const
QString
band_frequencies
[]
=
static
const
QString
vlc_
band_frequencies
[]
=
{
{
" 60 Hz "
,
" 170 Hz "
,
" 310 Hz "
,
" 600 Hz "
,
" 1 kHz "
,
" 60 Hz "
,
" 170 Hz "
,
" 310 Hz "
,
" 600 Hz "
,
" 1 kHz "
,
" 3 kHz "
,
" 6 kHz "
,
" 12 kHz "
,
" 14 kHz "
,
" 16 kHz "
" 3 kHz "
,
" 6 kHz "
,
" 12 kHz "
,
" 14 kHz "
,
" 16 kHz "
};
};
static
const
QString
iso_band_frequencies
[]
=
{
" 31.25 Hz "
,
" 62.5 Hz "
,
" 125 Hz "
,
" 250 Hz "
,
" 500 Hz "
,
" 1 kHz "
,
" 2 kHz "
,
" 4 kHz "
,
" 8 kHz "
,
" 16 kHz "
};
Equalizer
::
Equalizer
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
)
:
Equalizer
::
Equalizer
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
)
:
QWidget
(
_parent
)
,
p_intf
(
_p_intf
)
QWidget
(
_parent
)
,
p_intf
(
_p_intf
)
{
{
...
@@ -912,6 +918,8 @@ Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) :
...
@@ -912,6 +918,8 @@ Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) :
presetsComboBox
=
ui
.
presetsCombo
;
presetsComboBox
=
ui
.
presetsCombo
;
CONNECT
(
presetsComboBox
,
activated
(
int
),
this
,
setCorePreset
(
int
)
);
CONNECT
(
presetsComboBox
,
activated
(
int
),
this
,
setCorePreset
(
int
)
);
b_vlcBands
=
var_InheritBool
(
p_intf
,
"equalizer-vlcfreqs"
);
/* Add the sliders for the Bands */
/* Add the sliders for the Bands */
QGridLayout
*
grid
=
new
QGridLayout
(
ui
.
frame
);
QGridLayout
*
grid
=
new
QGridLayout
(
ui
.
frame
);
grid
->
setMargin
(
0
);
grid
->
setMargin
(
0
);
...
@@ -923,7 +931,8 @@ Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) :
...
@@ -923,7 +931,8 @@ Equalizer::Equalizer( intf_thread_t *_p_intf, QWidget *_parent ) :
bands
[
i
]
->
setMinimumWidth
(
34
);
bands
[
i
]
->
setMinimumWidth
(
34
);
CONNECT
(
bands
[
i
],
valueChanged
(
int
),
this
,
setCoreBands
()
);
CONNECT
(
bands
[
i
],
valueChanged
(
int
),
this
,
setCoreBands
()
);
band_texts
[
i
]
=
new
QLabel
(
band_frequencies
[
i
]
+
"
\n
00.0dB"
);
band_texts
[
i
]
=
new
QLabel
(
b_vlcBands
?
vlc_band_frequencies
[
i
]
:
iso_band_frequencies
[
i
]
+
"
\n
00.0dB"
);
band_texts
[
i
]
->
setFont
(
smallFont
);
band_texts
[
i
]
->
setFont
(
smallFont
);
grid
->
addWidget
(
bands
[
i
],
0
,
i
);
grid
->
addWidget
(
bands
[
i
],
0
,
i
);
...
@@ -1002,7 +1011,23 @@ void Equalizer::updateUIFromCore()
...
@@ -1002,7 +1011,23 @@ void Equalizer::updateUIFromCore()
free
(
psz_pres
);
free
(
psz_pres
);
}
}
/* Functin called when enableButton is toggled */
void
Equalizer
::
changeFreqLabels
(
bool
b_useVlcBands
)
{
b_vlcBands
=
b_useVlcBands
;
const
QString
*
band_frequencies
=
b_vlcBands
?
vlc_band_frequencies
:
iso_band_frequencies
;
for
(
int
i
=
0
;
i
<
BANDS
;
i
++
)
{
const
float
f_val
=
(
float
)(
bands
[
i
]
->
value
()
)
/
10
-
20
;
QString
val
=
QString
(
"%1"
).
arg
(
f_val
,
5
,
'f'
,
1
);
band_texts
[
i
]
->
setText
(
band_frequencies
[
i
]
+
"
\n
"
+
val
+
"dB"
);
}
}
/* Function called when enableButton is toggled */
void
Equalizer
::
enable
()
void
Equalizer
::
enable
()
{
{
bool
en
=
ui
.
enableCheck
->
isChecked
();
bool
en
=
ui
.
enableCheck
->
isChecked
();
...
@@ -1065,6 +1090,10 @@ void Equalizer::setCoreBands()
...
@@ -1065,6 +1090,10 @@ void Equalizer::setCoreBands()
{
{
/**\todo smoothing */
/**\todo smoothing */
const
QString
*
band_frequencies
=
b_vlcBands
?
vlc_band_frequencies
:
iso_band_frequencies
;
QString
values
;
QString
values
;
for
(
int
i
=
0
;
i
<
BANDS
;
i
++
)
for
(
int
i
=
0
;
i
<
BANDS
;
i
++
)
{
{
...
@@ -1111,6 +1140,10 @@ void Equalizer::setCorePreset( int i_preset )
...
@@ -1111,6 +1140,10 @@ void Equalizer::setCorePreset( int i_preset )
char
*
psz_values
=
createValuesFromPreset
(
i_preset
);
char
*
psz_values
=
createValuesFromPreset
(
i_preset
);
if
(
!
psz_values
)
return
;
if
(
!
psz_values
)
return
;
const
QString
*
band_frequencies
=
b_vlcBands
?
vlc_band_frequencies
:
iso_band_frequencies
;
char
*
p
=
psz_values
;
char
*
p
=
psz_values
;
for
(
int
i
=
0
;
i
<
BANDS
&&
*
p
;
i
++
)
for
(
int
i
=
0
;
i
<
BANDS
&&
*
p
;
i
++
)
{
{
...
...
modules/gui/qt4/components/extended_panels.hpp
View file @
b8bdfbdb
...
@@ -93,10 +93,12 @@ public:
...
@@ -93,10 +93,12 @@ public:
char
*
createValuesFromPreset
(
int
i_preset
);
char
*
createValuesFromPreset
(
int
i_preset
);
void
updateUIFromCore
();
void
updateUIFromCore
();
void
changeFreqLabels
(
bool
);
private:
private:
Ui
::
EqualizerWidget
ui
;
Ui
::
EqualizerWidget
ui
;
QSlider
*
bands
[
BANDS
];
QSlider
*
bands
[
BANDS
];
QLabel
*
band_texts
[
BANDS
];
QLabel
*
band_texts
[
BANDS
];
bool
b_vlcBands
;
void
delCallbacks
(
vlc_object_t
*
);
void
delCallbacks
(
vlc_object_t
*
);
void
addCallbacks
(
vlc_object_t
*
);
void
addCallbacks
(
vlc_object_t
*
);
...
...
Write
Preview
Markdown
is supported
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