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
a82dc303
Commit
a82dc303
authored
Jan 07, 2010
by
Francois Cartegnie
Committed by
Rémi Denis-Courmont
Jan 10, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: introduce 'Muted' as a whole state, not as volume 0
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
722b9d0e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
3 deletions
+28
-3
include/vlc_aout.h
include/vlc_aout.h
+2
-0
src/audio_output/intf.c
src/audio_output/intf.c
+23
-3
src/libvlc.c
src/libvlc.c
+1
-0
src/libvlccore.sym
src/libvlccore.sym
+2
-0
No files found.
include/vlc_aout.h
View file @
a82dc303
...
@@ -320,6 +320,8 @@ VLC_EXPORT( int, __aout_VolumeUp, ( vlc_object_t *, int, audio_volume_t * ) );
...
@@ -320,6 +320,8 @@ VLC_EXPORT( int, __aout_VolumeUp, ( vlc_object_t *, int, audio_volume_t * ) );
VLC_EXPORT
(
int
,
__aout_VolumeDown
,
(
vlc_object_t
*
,
int
,
audio_volume_t
*
)
);
VLC_EXPORT
(
int
,
__aout_VolumeDown
,
(
vlc_object_t
*
,
int
,
audio_volume_t
*
)
);
#define aout_ToggleMute(a, b) __aout_ToggleMute(VLC_OBJECT(a), b)
#define aout_ToggleMute(a, b) __aout_ToggleMute(VLC_OBJECT(a), b)
VLC_EXPORT
(
int
,
__aout_ToggleMute
,
(
vlc_object_t
*
,
audio_volume_t
*
)
);
VLC_EXPORT
(
int
,
__aout_ToggleMute
,
(
vlc_object_t
*
,
audio_volume_t
*
)
);
VLC_EXPORT
(
int
,
aout_SetMute
,
(
vlc_object_t
*
,
audio_volume_t
*
,
bool
)
);
VLC_EXPORT
(
bool
,
aout_IsMuted
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
int
,
aout_FindAndRestart
,
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
)
);
VLC_EXPORT
(
int
,
aout_FindAndRestart
,
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
)
);
VLC_EXPORT
(
int
,
aout_ChannelsRestart
,
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
)
);
VLC_EXPORT
(
int
,
aout_ChannelsRestart
,
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
)
);
...
...
src/audio_output/intf.c
View file @
a82dc303
...
@@ -132,7 +132,6 @@ int __aout_VolumeSet( vlc_object_t * p_object, audio_volume_t i_volume )
...
@@ -132,7 +132,6 @@ int __aout_VolumeSet( vlc_object_t * p_object, audio_volume_t i_volume )
int
__aout_VolumeUp
(
vlc_object_t
*
p_object
,
int
i_nb_steps
,
int
__aout_VolumeUp
(
vlc_object_t
*
p_object
,
int
i_nb_steps
,
audio_volume_t
*
pi_volume
)
audio_volume_t
*
pi_volume
)
{
{
const
int
i_volume_step
=
config_GetInt
(
p_object
->
p_libvlc
,
"volume-step"
);
const
int
i_volume_step
=
config_GetInt
(
p_object
->
p_libvlc
,
"volume-step"
);
int
i_volume
=
config_GetInt
(
p_object
,
"volume"
)
+
int
i_volume
=
config_GetInt
(
p_object
,
"volume"
)
+
...
@@ -166,12 +165,34 @@ int __aout_VolumeDown( vlc_object_t * p_object, int i_nb_steps,
...
@@ -166,12 +165,34 @@ int __aout_VolumeDown( vlc_object_t * p_object, int i_nb_steps,
* function (muted => 0).
* function (muted => 0).
*****************************************************************************/
*****************************************************************************/
int
__aout_ToggleMute
(
vlc_object_t
*
p_object
,
audio_volume_t
*
pi_volume
)
int
__aout_ToggleMute
(
vlc_object_t
*
p_object
,
audio_volume_t
*
pi_volume
)
{
return
aout_SetMute
(
p_object
,
pi_volume
,
!
aout_IsMuted
(
p_object
)
);
}
/*****************************************************************************
* aout_IsMuted : Get the output volume mute status
*****************************************************************************/
bool
aout_IsMuted
(
vlc_object_t
*
p_object
)
{
return
(
bool
)
var_GetBool
(
p_object
->
p_libvlc
,
"volume-muted"
);
}
/*****************************************************************************
* aout_SetMute : Sets mute status
*****************************************************************************
* If pi_volume != NULL, *pi_volume will contain the volume at the end of the
* function (muted => 0).
*****************************************************************************/
int
aout_SetMute
(
vlc_object_t
*
p_object
,
audio_volume_t
*
pi_volume
,
bool
b_mute
)
{
{
int
i_result
;
int
i_result
;
audio_volume_t
i_volume
;
audio_volume_t
i_volume
;
var_SetBool
(
p_object
->
p_libvlc
,
"volume-muted"
,
(
bool
)
b_mute
);
i_volume
=
(
audio_volume_t
)
config_GetInt
(
p_object
,
"volume"
);
i_volume
=
(
audio_volume_t
)
config_GetInt
(
p_object
,
"volume"
);
if
(
i_volume
!=
0
)
if
(
b_mute
)
{
{
/* Mute */
/* Mute */
i_result
=
aout_VolumeSet
(
p_object
,
AOUT_VOLUME_MIN
);
i_result
=
aout_VolumeSet
(
p_object
,
AOUT_VOLUME_MIN
);
...
@@ -188,7 +209,6 @@ int __aout_ToggleMute( vlc_object_t * p_object, audio_volume_t * pi_volume )
...
@@ -188,7 +209,6 @@ int __aout_ToggleMute( vlc_object_t * p_object, audio_volume_t * pi_volume )
i_result
=
aout_VolumeSet
(
p_object
,
i_volume
);
i_result
=
aout_VolumeSet
(
p_object
,
i_volume
);
if
(
pi_volume
!=
NULL
)
*
pi_volume
=
i_volume
;
if
(
pi_volume
!=
NULL
)
*
pi_volume
=
i_volume
;
}
}
return
i_result
;
return
i_result
;
}
}
...
...
src/libvlc.c
View file @
a82dc303
...
@@ -859,6 +859,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -859,6 +859,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
/* Create volume callback system. (this variable must be created before
/* Create volume callback system. (this variable must be created before
all interfaces as they can use it) */
all interfaces as they can use it) */
var_Create
(
p_libvlc
,
"volume-change"
,
VLC_VAR_BOOL
);
var_Create
(
p_libvlc
,
"volume-change"
,
VLC_VAR_BOOL
);
var_Create
(
p_libvlc
,
"volume-muted"
,
VLC_VAR_BOOL
);
psz_modules
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"extraintf"
);
psz_modules
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"extraintf"
);
psz_control
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"control"
);
psz_control
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"control"
);
...
...
src/libvlccore.sym
View file @
a82dc303
...
@@ -25,6 +25,8 @@ aout_OutputNextBuffer
...
@@ -25,6 +25,8 @@ aout_OutputNextBuffer
__aout_VolumeDown
__aout_VolumeDown
__aout_VolumeGet
__aout_VolumeGet
__aout_ToggleMute
__aout_ToggleMute
aout_IsMuted
aout_SetMute
aout_VolumeNoneInit
aout_VolumeNoneInit
__aout_VolumeSet
__aout_VolumeSet
aout_VolumeSoftInit
aout_VolumeSoftInit
...
...
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