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
e7e26e38
Commit
e7e26e38
authored
Apr 10, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: SoundSlider: don't fire back signal when a change comes from lib
parent
f8fe27ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
modules/gui/qt4/components/controller_widget.cpp
modules/gui/qt4/components/controller_widget.cpp
+13
-5
modules/gui/qt4/components/controller_widget.hpp
modules/gui/qt4/components/controller_widget.hpp
+5
-0
No files found.
modules/gui/qt4/components/controller_widget.cpp
View file @
e7e26e38
...
...
@@ -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_is_muted
(
false
)
b_is_muted
(
false
)
,
b_ignore_valuechanged
(
false
)
{
/* We need a layout for this widget */
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
this
);
...
...
@@ -113,7 +113,8 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
/* Volume control connection */
volumeSlider
->
setTracking
(
true
);
CONNECT
(
volumeSlider
,
valueChanged
(
int
),
this
,
userUpdateVolume
(
int
)
);
CONNECT
(
volumeSlider
,
valueChanged
(
int
),
this
,
valueChangedFilter
(
int
)
);
CONNECT
(
this
,
valueReallyChanged
(
int
),
this
,
userUpdateVolume
(
int
)
);
CONNECT
(
THEMIM
,
volumeChanged
(
void
),
this
,
libUpdateVolume
(
void
)
);
CONNECT
(
THEMIM
,
soundMuteChanged
(
void
),
this
,
updateMuteStatus
(
void
)
);
}
...
...
@@ -164,12 +165,19 @@ void SoundWidget::libUpdateVolume()
i_volume
=
aout_VolumeGet
(
p_playlist
);
i_volume
=
(
(
i_volume
+
1
)
*
VOLUME_MAX
)
/
(
AOUT_VOLUME_MAX
/
2
);
int
i_gauge
=
volumeSlider
->
value
();
if
(
!
b_is_muted
&&
/* do not show mute effect on volume (set to 0) */
(
i_volume
-
i_gauge
>
1
||
i_gauge
-
i_volume
>
1
)
)
if
(
i_volume
-
i_gauge
!=
0
)
{
b_ignore_valuechanged
=
true
;
volumeSlider
->
setValue
(
i_volume
);
b_ignore_valuechanged
=
false
;
}
refreshLabels
();
}
void
SoundWidget
::
valueChangedFilter
(
int
i_val
)
{
/* valueChanged is also emitted when the lib setValue() */
if
(
!
b_ignore_valuechanged
)
emit
valueReallyChanged
(
i_val
);
}
/* libvlc mute/unmute event slot */
...
...
modules/gui/qt4/components/controller_widget.hpp
View file @
e7e26e38
...
...
@@ -86,6 +86,7 @@ private:
QMenu
*
volumeMenu
;
virtual
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
e
);
bool
b_is_muted
;
bool
b_ignore_valuechanged
;
protected
slots
:
void
userUpdateVolume
(
int
);
...
...
@@ -93,6 +94,10 @@ protected slots:
void
updateMuteStatus
(
void
);
void
refreshLabels
(
void
);
void
showVolumeMenu
(
QPoint
pos
);
void
valueChangedFilter
(
int
);
signals:
void
valueReallyChanged
(
int
);
};
#endif
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