Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
35eeabbf
Commit
35eeabbf
authored
Sep 03, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: compressor UI, foolproofing the controls values
And translate strings
parent
c285701c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
41 deletions
+33
-41
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+33
-41
No files found.
modules/gui/qt4/components/extended_panels.cpp
View file @
35eeabbf
...
...
@@ -1122,35 +1122,27 @@ void Equalizer::addCallbacks( aout_instance_t *p_aout )
/**********************************************************************
* Dynamic range compressor
**********************************************************************/
static
const
char
*
psz_comp_control_names
[]
=
{
"compressor-rms-peak"
,
"compressor-attack"
,
"compressor-release"
,
"compressor-threshold"
,
"compressor-ratio"
,
"compressor-knee"
,
"compressor-makeup-gain"
};
static
const
char
*
psz_comp_control_descs
[]
=
typedef
struct
{
"RMS/peak"
,
"Attack"
,
"Release"
,
"Threshold"
,
"Ratio"
,
"Knee
\n
radius"
,
"Makeup
\n
gain"
}
;
static
const
char
*
psz_comp_control_units
[]
=
{
""
,
" ms"
,
" ms"
,
" dB"
,
":1"
,
" dB"
,
" dB"
};
static
const
float
f_comp_min_max_val_res_data
[]
=
const
char
*
psz_name
;
const
char
*
psz_descs
;
const
char
*
psz_units
;
const
float
f_min
;
// min
const
float
f_max
;
// max
const
float
f_value
;
// value
const
float
f_resolution
;
// resolution
}
comp_controls_t
;
static
const
comp_controls_t
controls
[]
=
{
// min max value resolution
//---- ------ ------ ----------
0.0
f
,
1.0
f
,
0.00
f
,
0.001
f
,
// RMS/peak
1.5
f
,
400.0
f
,
25.00
f
,
0.100
f
,
// Attack
2.0
f
,
800.0
f
,
100.00
f
,
0.100
f
,
// Release
-
30.0
f
,
0.0
f
,
-
11.00
f
,
0.010
f
,
// Threshold
1.0
f
,
20.0
f
,
8.00
f
,
0.010
f
,
// Ratio
1.0
f
,
10.0
f
,
2.50
f
,
0.010
f
,
// Knee radius
0.0
f
,
24.0
f
,
7.00
f
,
0.010
f
// Makeup gain
{
"compressor-rms-peak"
,
_
(
"RMS/peak"
),
""
,
0.0
f
,
1.0
f
,
0.00
f
,
0.001
f
},
{
"compressor-attack"
,
_
(
"Attack"
),
_
(
" ms"
),
1.5
f
,
400.0
f
,
25.00
f
,
0.100
f
},
{
"compressor-release"
,
_
(
"Release"
),
_
(
" ms"
),
2.0
f
,
800.0
f
,
100.00
f
,
0.100
f
},
{
"compressor-threshold"
,
_
(
"Threshold"
),
_
(
" dB"
),
-
30.0
f
,
0.0
f
,
-
11.00
f
,
0.010
f
},
{
"compressor-ratio"
,
_
(
"Ratio"
),
":1"
,
1.0
f
,
20.0
f
,
8.00
f
,
0.010
f
},
{
"compressor-knee"
,
_
(
"Knee
\n
radius"
),
_
(
" dB"
),
1.0
f
,
10.0
f
,
2.50
f
,
0.010
f
},
{
"compressor-makeup-gain"
,
_
(
"Makeup
\n
gain"
),
_
(
" dB"
),
0.0
f
,
24.0
f
,
7.00
f
,
0.010
f
},
};
Compressor
::
Compressor
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
)
:
...
...
@@ -1169,19 +1161,19 @@ Compressor::Compressor( intf_thread_t *_p_intf, QWidget *_parent ) :
{
compCtrl
[
i
]
=
new
QSlider
(
Qt
::
Vertical
);
const
int
i_min
=
(
int
)(
f_comp_min_max_val_res_data
[
4
*
i
+
0
]
/
f_comp_min_max_val_res_data
[
4
*
i
+
3
]
);
const
int
i_max
=
(
int
)(
f_comp_min_max_val_res_data
[
4
*
i
+
1
]
/
f_comp_min_max_val_res_data
[
4
*
i
+
3
]
);
const
int
i_val
=
(
int
)(
f_comp_min_max_val_res_data
[
4
*
i
+
2
]
/
f_comp_min_max_val_res_data
[
4
*
i
+
3
]
);
const
int
i_min
=
(
int
)(
controls
[
i
].
f_min
/
controls
[
i
].
f_resolution
);
const
int
i_max
=
(
int
)(
controls
[
i
].
f_max
/
controls
[
i
].
f_resolution
);
const
int
i_val
=
(
int
)(
controls
[
i
].
f_value
/
controls
[
i
].
f_resolution
);
compCtrl
[
i
]
->
setMinimum
(
i_min
);
compCtrl
[
i
]
->
setMaximum
(
i_max
);
compCtrl
[
i
]
->
setValue
(
i_val
);
oldControlVars
[
i
]
=
f_comp_min_max_val_res_data
[
4
*
i
+
2
]
;
oldControlVars
[
i
]
=
controls
[
i
].
f_value
;
CONNECT
(
compCtrl
[
i
],
valueChanged
(
int
),
this
,
setInitValues
()
);
ctrl_texts
[
i
]
=
new
QLabel
(
qtr
(
psz_comp_control_descs
[
i
]
)
ctrl_texts
[
i
]
=
new
QLabel
(
qtr
(
controls
[
i
].
psz_descs
)
+
qtr
(
"
\n
"
)
);
ctrl_texts
[
i
]
->
setFont
(
smallFont
);
ctrl_texts
[
i
]
->
setAlignment
(
Qt
::
AlignHCenter
);
...
...
@@ -1205,7 +1197,7 @@ Compressor::Compressor( intf_thread_t *_p_intf, QWidget *_parent ) :
for
(
int
i
=
0
;
i
<
NUM_CP_CTRL
;
i
++
)
{
controlVars
[
i
]
=
var_GetFloat
(
p_aout
,
psz_comp_control_names
[
i
]
);
controls
[
i
].
psz_name
);
}
vlc_object_release
(
p_aout
);
}
...
...
@@ -1215,7 +1207,7 @@ Compressor::Compressor( intf_thread_t *_p_intf, QWidget *_parent ) :
for
(
int
i
=
0
;
i
<
NUM_CP_CTRL
;
i
++
)
{
controlVars
[
i
]
=
config_GetFloat
(
p_intf
,
psz_comp_control_names
[
i
]
);
controls
[
i
].
psz_name
);
}
}
if
(
psz_af
&&
strstr
(
psz_af
,
"compressor"
)
!=
NULL
)
...
...
@@ -1252,7 +1244,7 @@ void Compressor::updateSliders( float * controlVars )
if
(
oldControlVars
[
i
]
!=
controlVars
[
i
]
)
{
const
int
i_val
=
(
int
)(
controlVars
[
i
]
/
f_comp_min_max_val_res_data
[
4
*
i
+
3
]
);
/
controls
[
i
].
f_resolution
);
compCtrl
[
i
]
->
setValue
(
i_val
);
}
}
...
...
@@ -1270,16 +1262,16 @@ void Compressor::setValues( float * controlVars )
for
(
int
i
=
0
;
i
<
NUM_CP_CTRL
;
i
++
)
{
float
f
=
(
float
)(
compCtrl
[
i
]
->
value
()
)
*
(
f_comp_min_max_val_res_data
[
4
*
i
+
3
]
);
*
(
controls
[
i
].
f_resolution
);
ctrl_readout
[
i
]
->
setText
(
QString
::
number
(
f
,
'f'
,
1
)
+
qtr
(
psz_comp_control_units
[
i
]
)
);
+
qtr
(
controls
[
i
].
psz_units
)
);
if
(
oldControlVars
[
i
]
!=
f
)
{
if
(
p_aout
)
{
var_SetFloat
(
p_aout
,
psz_comp_control_names
[
i
]
,
f
);
var_SetFloat
(
p_aout
,
controls
[
i
].
psz_name
,
f
);
}
config_PutFloat
(
p_intf
,
psz_comp_control_names
[
i
]
,
f
);
config_PutFloat
(
p_intf
,
controls
[
i
].
psz_name
,
f
);
oldControlVars
[
i
]
=
f
;
}
}
...
...
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