Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
39190a25
Commit
39190a25
authored
Feb 23, 2006
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LibVLC basic audio control API
parent
4c1f3ee9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
0 deletions
+92
-0
src/Makefile.am
src/Makefile.am
+1
-0
src/control/libvlc_audio.c
src/control/libvlc_audio.c
+91
-0
No files found.
src/Makefile.am
View file @
39190a25
...
...
@@ -321,6 +321,7 @@ SOURCES_libvlc_common = \
control/libvlc_vlm.c
\
control/libvlc_input.c
\
control/libvlc_video.c
\
control/libvlc_audio.c
\
control/mediacontrol_core.c
\
control/mediacontrol_util.c
\
control/mediacontrol_audio_video.c
\
...
...
src/control/libvlc_audio.c
0 → 100644
View file @
39190a25
/*****************************************************************************
* libvlc_audio.c: New libvlc audio control API
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
*
* Authors: Filippo Carone <filippo@carone.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <libvlc_internal.h>
#include <vlc/libvlc.h>
#include <audio_output.h>
/* for audio_volume_t, AOUT_VOLUME_MAX */
#include <vlc/intf.h>
/*****************************************************************************
* libvlc_audio_get_mute : Get the volume state, true if muted
*****************************************************************************/
vlc_bool_t
libvlc_audio_get_mute
(
libvlc_instance_t
*
p_instance
,
libvlc_exception_t
*
p_exception
)
{
/*
* If the volume level is 0, then the channel is muted
*/
audio_volume_t
i_volume
;
i_volume
=
libvlc_audio_volume_get
(
p_instance
,
p_exception
);
if
(
i_volume
==
0
)
return
VLC_TRUE
;
return
VLC_FALSE
;
}
void
libvlc_audio_set_mute
(
libvlc_instance_t
*
p_instance
,
vlc_bool_t
status
,
libvlc_exception_t
*
p_exception
)
{
if
(
status
)
{
aout_VolumeMute
(
p_instance
->
p_vlc
,
NULL
);
}
else
{
/* we need to get the volume back from the last registered level */
/// \todo FIXME here
}
}
/*****************************************************************************
* libvlc_audio_volume_get : Get the current volume (range 0-200 %)
*****************************************************************************/
int
libvlc_audio_volume_get
(
libvlc_instance_t
*
p_instance
,
libvlc_exception_t
*
p_exception
)
{
audio_volume_t
i_volume
;
aout_VolumeGet
(
p_instance
->
p_vlc
,
&
i_volume
);
return
i_volume
*
200
/
AOUT_VOLUME_MAX
;
}
/*****************************************************************************
* libvlc_audio_volume_set : Set the current volume
*****************************************************************************/
void
libvlc_audio_volume_set
(
libvlc_instance_t
*
p_instance
,
int
i_volume
,
libvlc_exception_t
*
p_exception
)
{
/** \todo raise exception when volume is not within range */
if
(
i_volume
>=
0
&&
i_volume
<=
200
)
{
i_volume
=
i_volume
*
AOUT_VOLUME_MAX
/
200
;
aout_VolumeSet
(
p_instance
->
p_vlc
,
i_volume
);
}
else
{
libvlc_exception_raise
(
p_exception
,
"Volume out of range"
);
}
}
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