Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
18addd46
Commit
18addd46
authored
Jan 08, 2010
by
Francois Cartegnie
Committed by
Rémi Denis-Courmont
Jan 10, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: remove the b_mybutton hack. Connect the appropriate events.
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
1a4bb059
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
15 deletions
+12
-15
modules/gui/qt4/components/controller_widget.cpp
modules/gui/qt4/components/controller_widget.cpp
+9
-14
modules/gui/qt4/components/controller_widget.hpp
modules/gui/qt4/components/controller_widget.hpp
+0
-1
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+3
-0
No files found.
modules/gui/qt4/components/controller_widget.cpp
View file @
18addd46
...
...
@@ -43,7 +43,7 @@
SoundWidget
::
SoundWidget
(
QWidget
*
_parent
,
intf_thread_t
*
_p_intf
,
bool
b_shiny
,
bool
b_special
)
:
QWidget
(
_parent
),
p_intf
(
_p_intf
),
b_
my_volume
(
false
),
b_
is_muted
(
false
)
b_is_muted
(
false
)
{
/* We need a layout for this widget */
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
this
);
...
...
@@ -118,7 +118,8 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
updateVolume
(
volumeSlider
->
value
()
);
/* Volume control connection */
CONNECT
(
volumeSlider
,
valueChanged
(
int
),
this
,
updateVolume
(
int
)
);
CONNECT
(
volumeSlider
,
valueChanged
(
int
),
this
,
refreshLabels
(
void
)
);
CONNECT
(
volumeSlider
,
sliderMoved
(
int
),
this
,
updateVolume
(
int
)
);
CONNECT
(
THEMIM
,
volumeChanged
(
void
),
this
,
updateVolume
(
void
)
);
CONNECT
(
THEMIM
,
soundMuteChanged
(
void
),
this
,
updateMuteStatus
(
void
)
);
}
...
...
@@ -151,15 +152,12 @@ void SoundWidget::refreshLabels()
/* volumeSlider changed value event slot */
void
SoundWidget
::
updateVolume
(
int
i_sliderVolume
)
{
if
(
!
b_my_volume
)
/* Only if volume is set by user action on slider */
{
setMuted
(
false
);
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
);
int
i_res
=
i_sliderVolume
*
(
AOUT_VOLUME_MAX
/
2
)
/
VOLUME_MAX
;
aout_VolumeSet
(
p_playlist
,
i_res
);
pl_Release
(
p_intf
);
}
refreshLabels
();
/* Only if volume is set by user action on slider */
setMuted
(
false
);
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
);
int
i_res
=
i_sliderVolume
*
(
AOUT_VOLUME_MAX
/
2
)
/
VOLUME_MAX
;
aout_VolumeSet
(
p_playlist
,
i_res
);
pl_Release
(
p_intf
);
}
/* libvlc changed value event slot */
...
...
@@ -173,14 +171,11 @@ void SoundWidget::updateVolume()
pl_Release
(
p_intf
);
i_volume
=
(
(
i_volume
+
1
)
*
VOLUME_MAX
)
/
(
AOUT_VOLUME_MAX
/
2
);
int
i_gauge
=
volumeSlider
->
value
();
b_my_volume
=
false
;
if
(
!
b_is_muted
&&
/* do not show mute effect on volume (set to 0) */
(
i_volume
-
i_gauge
>
1
||
i_gauge
-
i_volume
>
1
)
)
{
b_my_volume
=
true
;
volumeSlider
->
setValue
(
i_volume
);
b_my_volume
=
false
;
}
}
...
...
modules/gui/qt4/components/controller_widget.hpp
View file @
18addd46
...
...
@@ -83,7 +83,6 @@ private:
QLabel
*
volMuteLabel
;
QAbstractSlider
*
volumeSlider
;
QFrame
*
volumeControlWidget
;
bool
b_my_volume
;
QMenu
*
volumeMenu
;
virtual
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
e
);
bool
b_is_muted
;
...
...
modules/gui/qt4/util/input_slider.cpp
View file @
18addd46
...
...
@@ -235,6 +235,7 @@ void SoundSlider::wheelEvent( QWheelEvent *event )
setValue
(
__MIN
(
__MAX
(
minimum
(),
newvalue
),
maximum
()
)
);
emit
sliderReleased
();
emit
sliderMoved
(
value
()
);
}
void
SoundSlider
::
mousePressEvent
(
QMouseEvent
*
event
)
...
...
@@ -246,6 +247,7 @@ void SoundSlider::mousePressEvent( QMouseEvent *event )
i_oldvalue
=
value
();
emit
sliderPressed
();
changeValue
(
event
->
x
()
-
paddingL
);
emit
sliderMoved
(
value
()
);
}
}
...
...
@@ -257,6 +259,7 @@ void SoundSlider::mouseReleaseEvent( QMouseEvent *event )
{
emit
sliderReleased
();
setValue
(
value
()
);
emit
sliderMoved
(
value
()
);
}
b_isSliding
=
false
;
b_mouseOutside
=
false
;
...
...
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