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
517c9e5a
Commit
517c9e5a
authored
May 16, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/gui/wxwindows/interface.cpp: config_GetInt() inside VLCVolCtrl::OnPaint() is a bad idea.
parent
9b6096ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
modules/gui/wxwindows/interface.cpp
modules/gui/wxwindows/interface.cpp
+11
-6
No files found.
modules/gui/wxwindows/interface.cpp
View file @
517c9e5a
...
...
@@ -94,6 +94,7 @@ public:
wxVolCtrl
*
gauge
;
int
i_y_offset
;
vlc_bool_t
b_mute
;
intf_thread_t
*
p_intf
;
};
...
...
@@ -351,7 +352,6 @@ void Interface::Update()
{
/* Misc updates */
((
VLCVolCtrl
*
)
volctrl
)
->
UpdateVolume
();
}
void
Interface
::
OnControlEvent
(
wxCommandEvent
&
event
)
...
...
@@ -1374,6 +1374,7 @@ public:
virtual
~
wxVolCtrl
()
{};
void
UpdateVolume
();
int
GetVolume
();
void
OnChange
(
wxMouseEvent
&
event
);
...
...
@@ -1428,7 +1429,7 @@ VLCVolCtrl::VLCVolCtrl( intf_thread_t *_p_intf, wxWindow *p_parent )
:
wxControl
(
p_parent
,
-
1
,
wxDefaultPosition
,
wxSize
(
64
,
VLCVOL_HEIGHT
),
wxBORDER_NONE
),
i_y_offset
((
VLCVOL_HEIGHT
-
TOOLBAR_BMP_HEIGHT
)
/
2
),
p_intf
(
_p_intf
)
b_mute
(
0
),
p_intf
(
_p_intf
)
{
gauge
=
new
wxVolCtrl
(
p_intf
,
this
,
-
1
,
wxPoint
(
18
,
i_y_offset
),
wxSize
(
44
,
TOOLBAR_BMP_HEIGHT
)
);
...
...
@@ -1436,11 +1437,8 @@ VLCVolCtrl::VLCVolCtrl( intf_thread_t *_p_intf, wxWindow *p_parent )
void
VLCVolCtrl
::
OnPaint
(
wxPaintEvent
&
evt
)
{
int
i_volume
;
i_volume
=
(
audio_volume_t
)
config_GetInt
(
p_intf
,
"volume"
);
wxPaintDC
dc
(
this
);
wxBitmap
mPlayBitmap
(
i_volume
?
speaker_xpm
:
speaker_mute
_xpm
);
wxBitmap
mPlayBitmap
(
b_mute
?
speaker_mute_xpm
:
speaker
_xpm
);
dc
.
DrawBitmap
(
mPlayBitmap
,
0
,
i_y_offset
,
TRUE
);
}
...
...
@@ -1450,12 +1448,19 @@ void VLCVolCtrl::OnChange( wxMouseEvent& event )
{
int
i_volume
;
aout_VolumeMute
(
p_intf
,
(
audio_volume_t
*
)
&
i_volume
);
b_mute
=
!
b_mute
;
Refresh
();
}
}
void
VLCVolCtrl
::
UpdateVolume
()
{
gauge
->
UpdateVolume
();
int
i_volume
=
gauge
->
GetValue
();
if
(
!!
i_volume
==
!
b_mute
)
return
;
b_mute
=
!
b_mute
;
Refresh
();
}
...
...
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