Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
83ad48a4
Commit
83ad48a4
authored
Jul 03, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: partly fix volume display
parent
b092d34b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
33 deletions
+16
-33
modules/gui/qt4/components/controller_widget.cpp
modules/gui/qt4/components/controller_widget.cpp
+7
-10
modules/gui/qt4/components/controller_widget.hpp
modules/gui/qt4/components/controller_widget.hpp
+1
-1
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+4
-18
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+4
-4
No files found.
modules/gui/qt4/components/controller_widget.cpp
View file @
83ad48a4
...
...
@@ -109,7 +109,8 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
layout
->
addWidget
(
volumeSlider
,
0
,
Qt
::
AlignBottom
);
/* Set the volume from the config */
libUpdateVolume
();
float
volume
=
aout_VolumeGet
(
THEPL
);
libUpdateVolume
(
(
volume
>=
0.
f
)
?
volume
:
1.
f
);
/* Sync mute status */
if
(
aout_MuteGet
(
THEPL
)
>
0
)
updateMuteStatus
(
true
);
...
...
@@ -118,7 +119,7 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
volumeSlider
->
setTracking
(
true
);
CONNECT
(
volumeSlider
,
valueChanged
(
int
),
this
,
valueChangedFilter
(
int
)
);
CONNECT
(
this
,
valueReallyChanged
(
int
),
this
,
userUpdateVolume
(
int
)
);
CONNECT
(
THEMIM
,
volumeChanged
(
void
),
this
,
libUpdateVolume
(
void
)
);
CONNECT
(
THEMIM
,
volumeChanged
(
float
),
this
,
libUpdateVolume
(
float
)
);
CONNECT
(
THEMIM
,
soundMuteChanged
(
bool
),
this
,
updateMuteStatus
(
bool
)
);
}
...
...
@@ -152,19 +153,15 @@ 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
);
aout_VolumeSet
(
p_playlist
,
i_sliderVolume
/
100.
f
);
aout_VolumeSet
(
THEPL
,
i_sliderVolume
/
100.
f
);
refreshLabels
();
}
/* libvlc changed value event slot */
void
SoundWidget
::
libUpdateVolume
()
void
SoundWidget
::
libUpdateVolume
(
float
volume
)
{
/* Audio part */
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
long
i_volume
=
lroundf
(
aout_VolumeGet
(
p_playlist
)
*
100.
f
);
if
(
i_volume
-
volumeSlider
->
value
()
!=
0
)
long
i_volume
=
lroundf
(
volume
*
100.
f
);
if
(
i_volume
!=
volumeSlider
->
value
()
)
{
b_ignore_valuechanged
=
true
;
volumeSlider
->
setValue
(
i_volume
);
...
...
modules/gui/qt4/components/controller_widget.hpp
View file @
83ad48a4
...
...
@@ -117,7 +117,7 @@ private:
protected
slots
:
void
userUpdateVolume
(
int
);
void
libUpdateVolume
(
void
);
void
libUpdateVolume
(
float
);
void
updateMuteStatus
(
bool
);
void
refreshLabels
(
void
);
void
showVolumeMenu
(
QPoint
pos
);
...
...
modules/gui/qt4/input_manager.cpp
View file @
83ad48a4
...
...
@@ -51,8 +51,6 @@ static int PLItemAppended( vlc_object_t *, const char *,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
PLItemRemoved
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
VolumeChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
InputEvent
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
...
...
@@ -945,7 +943,7 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
:
QObject
(
NULL
),
p_intf
(
_p_intf
),
random
(
VLC_OBJECT
(
THEPL
),
"random"
),
repeat
(
VLC_OBJECT
(
THEPL
),
"repeat"
),
loop
(
VLC_OBJECT
(
THEPL
),
"loop"
),
mute
(
VLC_OBJECT
(
THEPL
),
"mute"
)
volume
(
VLC_OBJECT
(
THEPL
),
"volume"
),
mute
(
VLC_OBJECT
(
THEPL
),
"mute"
)
{
p_input
=
NULL
;
im
=
new
InputManager
(
this
,
p_intf
);
...
...
@@ -960,7 +958,7 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
repeat
.
addCallback
(
this
,
SLOT
(
notifyRepeatLoop
(
bool
))
);
loop
.
addCallback
(
this
,
SLOT
(
notifyRepeatLoop
(
bool
))
);
v
ar_AddCallback
(
THEPL
,
"volume"
,
VolumeChanged
,
this
);
v
olume
.
addCallback
(
this
,
SLOT
(
notifyVolume
(
int
))
);
mute
.
addCallback
(
this
,
SLOT
(
notifyMute
(
bool
))
);
/* Warn our embedded IM about input changes */
...
...
@@ -986,8 +984,6 @@ MainInputManager::~MainInputManager()
vlc_object_release
(
p_input
);
}
var_DelCallback
(
THEPL
,
"volume"
,
VolumeChanged
,
this
);
var_DelCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
im
);
var_DelCallback
(
THEPL
,
"leaf-to-parent"
,
LeafToParent
,
this
);
...
...
@@ -1016,9 +1012,6 @@ void MainInputManager::customEvent( QEvent *event )
// msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
switch
(
type
)
{
case
VolumeChanged_Type
:
emit
volumeChanged
();
return
;
case
PLItemAppended_Type
:
plEv
=
static_cast
<
PLEvent
*>
(
event
);
emit
playlistItemAppended
(
plEv
->
i_item
,
plEv
->
i_parent
);
...
...
@@ -1224,16 +1217,9 @@ static int LeafToParent( vlc_object_t *p_this, const char *psz_var,
return
VLC_SUCCESS
;
}
static
int
VolumeChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
void
MainInputManager
::
notifyVolume
(
int
volume
)
{
VLC_UNUSED
(
p_this
);
VLC_UNUSED
(
psz_var
);
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
newval
);
MainInputManager
*
mim
=
(
MainInputManager
*
)
param
;
IMEvent
*
event
=
new
IMEvent
(
VolumeChanged_Type
);
QApplication
::
postEvent
(
mim
,
event
);
return
VLC_SUCCESS
;
emit
volumeChanged
(
volume
/
(
float
)
AOUT_VOLUME_DEFAULT
);
}
void
MainInputManager
::
notifyMute
(
bool
mute
)
...
...
modules/gui/qt4/input_manager.hpp
View file @
83ad48a4
...
...
@@ -38,14 +38,12 @@
#include <QObject>
#include <QEvent>
enum
{
PositionUpdate_Type
=
QEvent
::
User
+
IMEventType
+
1
,
ItemChanged_Type
,
ItemStateChanged_Type
,
ItemTitleChanged_Type
,
ItemRateChanged_Type
,
VolumeChanged_Type
,
ItemEsChanged_Type
,
ItemTeletextChanged_Type
,
InterfaceVoutUpdate_Type
,
...
...
@@ -276,6 +274,7 @@ private:
input_thread_t
*
p_input
;
intf_thread_t
*
p_intf
;
QVLCBool
random
,
repeat
,
loop
;
QVLCInteger
volume
;
QVLCBool
mute
;
public
slots
:
...
...
@@ -293,11 +292,12 @@ public slots:
private
slots
:
void
notifyRandom
(
bool
);
void
notifyRepeatLoop
(
bool
);
void
notifyVolume
(
int
);
void
notifyMute
(
bool
);
signals:
void
inputChanged
(
input_thread_t
*
);
void
volumeChanged
();
void
soundMuteChanged
(
bool
);
void
volumeChanged
(
float
);
void
soundMuteChanged
(
bool
);
void
playlistItemAppended
(
int
itemId
,
int
parentId
);
void
playlistItemRemoved
(
int
itemId
);
void
playlistNotEmpty
(
bool
);
...
...
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