Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
b5d005ce
Commit
b5d005ce
authored
Dec 26, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: compressor: simplify by grouping
parent
68c78f8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
28 deletions
+15
-28
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+14
-26
modules/gui/qt4/components/extended_panels.hpp
modules/gui/qt4/components/extended_panels.hpp
+1
-2
No files found.
modules/gui/qt4/components/extended_panels.cpp
View file @
b5d005ce
...
...
@@ -1258,11 +1258,12 @@ Compressor::Compressor( intf_thread_t *_p_intf, QWidget *_parent )
QFont
smallFont
=
QApplication
::
font
();
smallFont
.
setPointSize
(
smallFont
.
pointSize
()
-
2
);
Q
GridLayout
*
layout
=
new
QGrid
Layout
(
this
);
enableCheck
=
new
QCheckBox
(
qtr
(
"Enable dynamic range compressor"
)
);
layout
->
addWidget
(
enableCheck
,
0
,
0
,
1
,
NUM_CP_CTRL
);
Q
VBoxLayout
*
layout
=
new
QVBox
Layout
(
this
);
compressorBox
=
new
QGroupBox
(
qtr
(
"Enable dynamic range compressor"
)
);
compressorBox
->
setCheckable
(
true
);
layout
->
addWidget
(
compressorBox
);
QGridLayout
*
ctrlLayout
=
new
QGridLayout
(
compressorBox
);
for
(
int
i
=
0
;
i
<
NUM_CP_CTRL
;
i
++
)
{
const
int
i_min
=
(
int
)(
comp_controls
[
i
].
f_min
...
...
@@ -1287,16 +1288,14 @@ Compressor::Compressor( intf_thread_t *_p_intf, QWidget *_parent )
ctrl_readout
[
i
]
->
setFont
(
smallFont
);
ctrl_readout
[
i
]
->
setAlignment
(
Qt
::
AlignHCenter
);
layout
->
addWidget
(
compCtrl
[
i
],
1
,
i
,
Qt
::
AlignHCenter
);
layout
->
addWidget
(
ctrl_readout
[
i
],
2
,
i
,
Qt
::
AlignHCenter
);
layout
->
addWidget
(
ctrl_texts
[
i
],
3
,
i
,
Qt
::
AlignHCenter
);
ctrlLayout
->
addWidget
(
compCtrl
[
i
],
0
,
i
,
Qt
::
AlignHCenter
);
ctrlLayout
->
addWidget
(
ctrl_readout
[
i
],
1
,
i
,
Qt
::
AlignHCenter
);
ctrlLayout
->
addWidget
(
ctrl_texts
[
i
],
2
,
i
,
Qt
::
AlignHCenter
);
}
for
(
int
i
=
0
;
i
<
NUM_CP_CTRL
;
i
++
)
CONNECT
(
compCtrl
[
i
],
valueChanged
(
int
),
this
,
setValues
()
);
BUTTONACT
(
enableCheck
,
enable
()
);
/* Write down initial values */
vlc_object_t
*
p_aout
=
(
vlc_object_t
*
)
THEMIM
->
getAout
();
char
*
psz_af
;
...
...
@@ -1320,31 +1319,20 @@ Compressor::Compressor( intf_thread_t *_p_intf, QWidget *_parent )
comp_controls
[
i
].
psz_name
);
}
}
if
(
psz_af
&&
strstr
(
psz_af
,
"compressor"
)
!=
NULL
)
{
enableCheck
->
setChecked
(
true
);
}
compressorBox
->
setChecked
(
true
);
else
compressorBox
->
setChecked
(
false
);
free
(
psz_af
);
enable
(
enableCheck
->
isChecked
()
);
updateSliders
(
controlVars
);
setValues
();
}
void
Compressor
::
enable
()
{
bool
en
=
enableCheck
->
isChecked
();
playlist_EnableAudioFilter
(
THEPL
,
"compressor"
,
en
);
enable
(
en
);
}
void
Compressor
::
enable
(
bool
en
)
{
for
(
int
i
=
0
;
i
<
NUM_CP_CTRL
;
i
++
)
{
compCtrl
[
i
]
->
setEnabled
(
en
);
ctrl_texts
[
i
]
->
setEnabled
(
en
);
ctrl_readout
[
i
]
->
setEnabled
(
en
);
}
playlist_EnableAudioFilter
(
THEPL
,
"compressor"
,
compressorBox
->
isChecked
()
);
}
void
Compressor
::
updateSliders
(
float
*
p_controlVars
)
...
...
modules/gui/qt4/components/extended_panels.hpp
View file @
b5d005ce
...
...
@@ -127,7 +127,7 @@ private:
float
controlVars
[
NUM_CP_CTRL
];
float
oldControlVars
[
NUM_CP_CTRL
];
Q
CheckBox
*
enableCheck
;
Q
GroupBox
*
compressorBox
;
intf_thread_t
*
p_intf
;
...
...
@@ -137,7 +137,6 @@ private:
void
updateSliders
(
float
*
);
private
slots
:
void
enable
(
bool
);
void
enable
();
void
setValues
();
};
...
...
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