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
ca802f69
Commit
ca802f69
authored
Sep 24, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: simplify volume management
parent
fa240c0b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
8 deletions
+5
-8
modules/gui/qt4/components/controller_widget.cpp
modules/gui/qt4/components/controller_widget.cpp
+2
-2
modules/gui/qt4/components/controller_widget.hpp
modules/gui/qt4/components/controller_widget.hpp
+1
-1
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+2
-2
modules/gui/qt4/qt4.hpp
modules/gui/qt4/qt4.hpp
+0
-3
No files found.
modules/gui/qt4/components/controller_widget.cpp
View file @
ca802f69
...
...
@@ -151,7 +151,7 @@ void SoundWidget::userUpdateVolume( int i_sliderVolume )
/* Only if volume is set by user action on slider */
setMuted
(
false
);
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
int
i_res
=
i_sliderVolume
*
QT_VOLUME_MAX
/
VOLUME_MAX
;
int
i_res
=
i_sliderVolume
*
(
AOUT_VOLUME_DEFAULT
*
2
)
/
VOLUME_MAX
;
aout_VolumeSet
(
p_playlist
,
i_res
);
refreshLabels
();
}
...
...
@@ -164,7 +164,7 @@ void SoundWidget::libUpdateVolume()
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
i_volume
=
aout_VolumeGet
(
p_playlist
);
i_volume
=
((
i_volume
+
1
)
*
VOLUME_MAX
)
/
QT_VOLUME_MAX
;
i_volume
=
((
i_volume
+
1
)
*
VOLUME_MAX
)
/
(
AOUT_VOLUME_DEFAULT
*
2
)
;
if
(
i_volume
-
volumeSlider
->
value
()
!=
0
)
{
...
...
modules/gui/qt4/components/controller_widget.hpp
View file @
ca802f69
...
...
@@ -67,7 +67,7 @@ private slots:
void
updateButtonIcons
(
bool
,
bool
);
};
#define VOLUME_MAX
(QT_VOLUME_MAX * 100 / QT_VOLUME_DEFAULT)
#define VOLUME_MAX
200
class
SoundWidget
:
public
QWidget
{
Q_OBJECT
...
...
modules/gui/qt4/components/simple_preferences.cpp
View file @
ca802f69
...
...
@@ -314,7 +314,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#undef audioCommon
/* Audio Options */
ui
.
volumeValue
->
setMaximum
(
QT_VOLUME_MAX
/
Q
T_VOLUME_DEFAULT
*
100
);
ui
.
volumeValue
->
setMaximum
(
(
AOUT_VOLUME_DEFAULT
*
2
)
/
AOU
T_VOLUME_DEFAULT
*
100
);
CONFIG_GENERIC_NO_BOOL
(
"volume"
,
IntegerRangeSlider
,
NULL
,
defaultVolume
);
CONNECT
(
ui
.
defaultVolume
,
valueChanged
(
int
),
...
...
@@ -738,7 +738,7 @@ SPrefsPanel::~SPrefsPanel()
void
SPrefsPanel
::
updateAudioVolume
(
int
volume
)
{
qobject_cast
<
QSpinBox
*>
(
optionWidgets
[
volLW
])
->
setValue
(
volume
*
100
/
Q
T_VOLUME_DEFAULT
);
->
setValue
(
volume
*
100
/
AOU
T_VOLUME_DEFAULT
);
}
...
...
modules/gui/qt4/qt4.hpp
View file @
ca802f69
...
...
@@ -122,9 +122,6 @@ struct intf_sys_t
#define getSettings() p_intf->p_sys->mainSettings
#define QT_VOLUME_DEFAULT AOUT_VOLUME_DEFAULT
#define QT_VOLUME_MAX (AOUT_VOLUME_DEFAULT * 2)
static
inline
QString
QVLCUserDir
(
vlc_userdir_t
type
)
{
char
*
dir
=
config_GetUserDir
(
type
);
...
...
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