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
96dfe793
Commit
96dfe793
authored
Jul 21, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
osd: update volume reporting (untested)
parent
eae1c91d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
src/osd/osd.c
src/osd/osd.c
+11
-16
No files found.
src/osd/osd.c
View file @
96dfe793
...
...
@@ -29,11 +29,13 @@
# include "config.h"
#endif
#include <math.h>
#include <vlc_common.h>
#include <vlc_keys.h>
#include <vlc_osd.h>
#include <vlc_image.h>
#include <vlc_modules.h>
#include <vlc_aout_intf.h>
#include "libvlc.h"
...
...
@@ -45,7 +47,6 @@
static
void
osd_UpdateState
(
osd_menu_state_t
*
,
int
,
int
,
int
,
int
,
picture_t
*
);
static
inline
osd_state_t
*
osd_VolumeStateChange
(
osd_state_t
*
,
int
);
static
int
osd_VolumeStep
(
vlc_object_t
*
,
int
,
int
);
static
bool
osd_ParserLoad
(
osd_menu_t
*
,
const
char
*
);
static
void
osd_ParserUnload
(
osd_menu_t
*
);
...
...
@@ -139,8 +140,6 @@ osd_menu_t *osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
{
osd_menu_t
*
p_osd
=
NULL
;
vlc_value_t
val
;
int
i_volume
=
0
;
int
i_steps
=
0
;
/* to be sure to avoid multiple creation */
vlc_mutex_lock
(
&
osd_mutex
);
...
...
@@ -172,10 +171,15 @@ osd_menu_t *osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
if
(
p_osd
->
p_state
->
p_volume
)
{
/* Update the volume state images to match the current volume */
i_volume
=
config_GetInt
(
p_this
,
"volume"
);
i_steps
=
osd_VolumeStep
(
p_this
,
i_volume
,
p_osd
->
p_state
->
p_volume
->
i_ranges
);
p_osd
->
p_state
->
p_volume
->
p_current_state
=
osd_VolumeStateChange
(
p_osd
->
p_state
->
p_volume
->
p_states
,
i_steps
);
float
vol
=
aout_VolumeGet
(
p_this
);
if
(
vol
>=
0
.
f
)
{
vol
*=
(
float
)
AOUT_VOLUME_DEFAULT
;
vol
/=
var_InheritInteger
(
p_this
,
"volume-step"
);
p_osd
->
p_state
->
p_volume
->
p_current_state
=
osd_VolumeStateChange
(
p_osd
->
p_state
->
p_volume
->
p_states
,
lroundf
(
vol
)
);
}
}
/* Initialize OSD state */
osd_UpdateState
(
p_osd
->
p_state
,
p_osd
->
i_x
,
p_osd
->
i_y
,
...
...
@@ -564,15 +568,6 @@ void osd_MenuDown( vlc_object_t *p_this )
vlc_mutex_unlock
(
&
osd_mutex
);
}
static
int
osd_VolumeStep
(
vlc_object_t
*
p_this
,
int
i_volume
,
int
i_steps
)
{
int
i_volume_step
=
0
;
(
void
)
i_steps
;
i_volume_step
=
config_GetInt
(
p_this
->
p_libvlc
,
"volume-step"
);
return
(
i_volume
/
i_volume_step
);
}
#undef osd_ButtonFind
osd_button_t
*
osd_ButtonFind
(
vlc_object_t
*
p_this
,
int
i_x
,
int
i_y
,
int
i_window_height
,
int
i_window_width
,
...
...
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