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
878ef195
Commit
878ef195
authored
Nov 23, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - take care of the volume-step value from the preferences.
parent
72f13c9d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+4
-2
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+4
-3
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+2
-1
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
878ef195
...
...
@@ -495,12 +495,14 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
volMuteLabel
->
installEventFilter
(
hVolLabel
);
controlLayout
->
addWidget
(
volMuteLabel
,
3
,
15
);
volumeSlider
=
new
SoundSlider
(
this
,
config_GetInt
(
p_intf
,
"qt-volume-complete"
)
);
volumeSlider
=
new
SoundSlider
(
this
,
config_GetInt
(
p_intf
,
"volume-step"
),
config_GetInt
(
p_intf
,
"qt-volume-complete"
)
);
volumeSlider
->
setMaximumSize
(
QSize
(
200
,
40
)
);
volumeSlider
->
setMinimumSize
(
QSize
(
80
,
20
)
);
volumeSlider
->
setFocusPolicy
(
Qt
::
NoFocus
);
controlLayout
->
addWidget
(
volumeSlider
,
3
,
16
,
1
,
2
);
/* Set the volume from the config */
volumeSlider
->
setValue
(
(
config_GetInt
(
p_intf
,
"volume"
)
)
*
VOLUME_MAX
/
(
AOUT_VOLUME_MAX
/
2
)
);
...
...
modules/gui/qt4/util/input_slider.cpp
View file @
878ef195
...
...
@@ -78,11 +78,12 @@ void InputSlider::mouseMoveEvent(QMouseEvent *event)
#define WHEIGHT 25 // px
#define SOUNDMIN 0 // %
#define SOUNDMAX 200 // % OR 400 ?
#define SOUNDSTEP 5 // %
SoundSlider
::
SoundSlider
(
QWidget
*
_parent
,
bool
b_hard
)
:
QAbstractSlider
(
_parent
)
SoundSlider
::
SoundSlider
(
QWidget
*
_parent
,
int
_i_step
,
bool
b_hard
)
:
QAbstractSlider
(
_parent
)
{
padding
=
5
;
f_step
=
(
_i_step
*
100
)
/
AOUT_VOLUME_MAX
;
setRange
(
SOUNDMIN
,
b_hard
?
(
2
*
SOUNDMAX
)
:
SOUNDMAX
);
pixGradient
=
QPixmap
(
QSize
(
WLENGTH
,
WHEIGHT
)
);
...
...
@@ -108,7 +109,7 @@ SoundSlider::SoundSlider( QWidget *_parent, bool b_hard ) : QAbstractSlider( _pa
void
SoundSlider
::
wheelEvent
(
QWheelEvent
*
event
)
{
int
newvalue
=
value
()
+
event
->
delta
()
/
(
8
*
15
)
*
SOUNDSTEP
;
int
newvalue
=
value
()
+
event
->
delta
()
/
(
8
*
15
)
*
f_step
;
setValue
(
__MIN
(
__MAX
(
minimum
(),
newvalue
),
maximum
()
)
);
emit
sliderReleased
();
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
878ef195
...
...
@@ -54,7 +54,7 @@ class SoundSlider : public QAbstractSlider
{
Q_OBJECT
public:
SoundSlider
(
QWidget
*
_parent
,
bool
b_softamp
);
SoundSlider
(
QWidget
*
_parent
,
int
_i_step
,
bool
b_softamp
);
virtual
~
SoundSlider
()
{};
protected:
int
padding
;
...
...
@@ -67,6 +67,7 @@ private:
bool
b_sliding
;
bool
b_outside
;
int
i_oldvalue
;
float
f_step
;
void
changeValue
(
int
x
);
QPixmap
pixGradient
;
QPixmap
pixLimit
;
...
...
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