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
bd8485fc
Commit
bd8485fc
authored
Jul 27, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: expose event for audio volume change (fixes #14568)
Cc: Harald Sitter <sitter@kde.org>
parent
09bea7fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
include/vlc/libvlc_events.h
include/vlc/libvlc_events.h
+6
-0
lib/event.c
lib/event.c
+1
-0
lib/media_player.c
lib/media_player.c
+20
-0
No files found.
include/vlc/libvlc_events.h
View file @
bd8485fc
...
...
@@ -81,6 +81,7 @@ enum libvlc_event_e {
libvlc_MediaPlayerUncorked
,
libvlc_MediaPlayerMuted
,
libvlc_MediaPlayerUnmuted
,
libvlc_MediaPlayerAudioVolume
,
libvlc_MediaListItemAdded
=
0x200
,
libvlc_MediaListWillAddItem
,
...
...
@@ -244,6 +245,11 @@ typedef struct libvlc_event_t
libvlc_track_type_t
i_type
;
int
i_id
;
}
media_player_es_changed
;
struct
{
float
volume
;
}
media_player_audio_volume
;
}
u
;
/**< Type-dependent event description */
}
libvlc_event_t
;
...
...
lib/event.c
View file @
bd8485fc
...
...
@@ -287,6 +287,7 @@ static const event_name_t event_list[] = {
DEF
(
MediaPlayerUncorked
)
DEF
(
MediaPlayerMuted
)
DEF
(
MediaPlayerUnmuted
)
DEF
(
MediaPlayerAudioVolume
)
DEF
(
MediaListItemAdded
)
DEF
(
MediaListWillAddItem
)
...
...
lib/media_player.c
View file @
bd8485fc
...
...
@@ -75,6 +75,10 @@ static int
mute_changed
(
vlc_object_t
*
obj
,
const
char
*
name
,
vlc_value_t
old
,
vlc_value_t
cur
,
void
*
opaque
);
static
int
volume_changed
(
vlc_object_t
*
obj
,
const
char
*
name
,
vlc_value_t
old
,
vlc_value_t
cur
,
void
*
opaque
);
static
void
add_es_callbacks
(
input_thread_t
*
p_input_thread
,
libvlc_media_player_t
*
p_mi
);
...
...
@@ -504,6 +508,19 @@ static int mute_changed(vlc_object_t *obj, const char *name, vlc_value_t old,
return
VLC_SUCCESS
;
}
static
int
volume_changed
(
vlc_object_t
*
obj
,
const
char
*
name
,
vlc_value_t
old
,
vlc_value_t
cur
,
void
*
opaque
)
{
libvlc_media_player_t
*
mp
=
(
libvlc_media_player_t
*
)
obj
;
libvlc_event_t
event
;
event
.
type
=
libvlc_MediaPlayerAudioVolume
;
event
.
u
.
media_player_audio_volume
.
volume
=
cur
.
f_float
;
libvlc_event_send
(
mp
->
p_event_manager
,
&
event
);
VLC_UNUSED
(
name
);
VLC_UNUSED
(
old
);
VLC_UNUSED
(
opaque
);
return
VLC_SUCCESS
;
}
/**************************************************************************
* Create a Media Instance object.
*
...
...
@@ -683,9 +700,11 @@ libvlc_media_player_new( libvlc_instance_t *instance )
register_event
(
mp
,
Uncorked
);
register_event
(
mp
,
Muted
);
register_event
(
mp
,
Unmuted
);
register_event
(
mp
,
AudioVolume
);
var_AddCallback
(
mp
,
"corks"
,
corks_changed
,
NULL
);
var_AddCallback
(
mp
,
"mute"
,
mute_changed
,
NULL
);
var_AddCallback
(
mp
,
"volume"
,
volume_changed
,
NULL
);
/* Snapshot initialization */
register_event
(
mp
,
SnapshotTaken
);
...
...
@@ -737,6 +756,7 @@ static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi )
"snapshot-file"
,
snapshot_was_taken
,
p_mi
);
/* Detach callback from the media player / input manager object */
var_DelCallback
(
p_mi
,
"volume"
,
volume_changed
,
NULL
);
var_DelCallback
(
p_mi
,
"mute"
,
mute_changed
,
NULL
);
var_DelCallback
(
p_mi
,
"corks"
,
corks_changed
,
NULL
);
...
...
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