Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Steve Lhomme
vlc
Commits
0c788078
Commit
0c788078
authored
Sep 04, 2017
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: move playlist_VolumeUp implementation to aout_VolumeUpdate
parent
0154e248
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
20 deletions
+34
-20
include/vlc_aout.h
include/vlc_aout.h
+4
-0
include/vlc_playlist.h
include/vlc_playlist.h
+1
-3
src/audio_output/output.c
src/audio_output/output.c
+27
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/playlist/aout.c
src/playlist/aout.c
+1
-17
No files found.
include/vlc_aout.h
View file @
0c788078
...
...
@@ -290,8 +290,12 @@ VLC_API void aout_FormatPrint(vlc_object_t *, const char *,
#define aout_FormatPrint(o, t, f) aout_FormatPrint(VLC_OBJECT(o), t, f)
VLC_API
const
char
*
aout_FormatPrintChannels
(
const
audio_sample_format_t
*
)
VLC_USED
;
#define AOUT_VOLUME_DEFAULT 256
#define AOUT_VOLUME_MAX 512
VLC_API
float
aout_VolumeGet
(
audio_output_t
*
);
VLC_API
int
aout_VolumeSet
(
audio_output_t
*
,
float
);
VLC_API
int
aout_VolumeUpdate
(
audio_output_t
*
,
int
,
float
*
);
VLC_API
int
aout_MuteGet
(
audio_output_t
*
);
VLC_API
int
aout_MuteSet
(
audio_output_t
*
,
bool
);
VLC_API
char
*
aout_DeviceGet
(
audio_output_t
*
);
...
...
include/vlc_playlist.h
View file @
0c788078
...
...
@@ -29,6 +29,7 @@ extern "C" {
# endif
#include <vlc_events.h>
#include <vlc_aout.h>
TYPEDEF_ARRAY
(
playlist_item_t
*
,
playlist_item_array_t
)
...
...
@@ -392,9 +393,6 @@ VLC_API void playlist_NodeDelete( playlist_t *, playlist_item_t * );
VLC_API
audio_output_t
*
playlist_GetAout
(
playlist_t
*
);
#define AOUT_VOLUME_DEFAULT 256
#define AOUT_VOLUME_MAX 512
VLC_API
float
playlist_VolumeGet
(
playlist_t
*
);
VLC_API
int
playlist_VolumeSet
(
playlist_t
*
,
float
);
VLC_API
int
playlist_VolumeUp
(
playlist_t
*
,
int
,
float
*
);
...
...
src/audio_output/output.c
View file @
0c788078
...
...
@@ -738,6 +738,33 @@ int aout_VolumeSet (audio_output_t *aout, float vol)
return
0
;
}
/**
* Raises the volume.
* \param value how much to increase (> 0) or decrease (< 0) the volume
* \param volp if non-NULL, will contain contain the resulting volume
*/
int
aout_VolumeUpdate
(
audio_output_t
*
aout
,
int
value
,
float
*
volp
)
{
int
ret
=
-
1
;
float
stepSize
=
var_InheritFloat
(
aout
,
"volume-step"
)
/
(
float
)
AOUT_VOLUME_DEFAULT
;
float
delta
=
value
*
stepSize
;
float
vol
=
aout_VolumeGet
(
aout
);
if
(
vol
>=
0
.
f
)
{
vol
+=
delta
;
if
(
vol
<
0
.
f
)
vol
=
0
.
f
;
if
(
vol
>
2
.
f
)
vol
=
2
.
f
;
vol
=
(
roundf
(
vol
/
stepSize
))
*
stepSize
;
if
(
volp
!=
NULL
)
*
volp
=
vol
;
ret
=
aout_VolumeSet
(
aout
,
vol
);
}
return
ret
;
}
/**
* Gets the audio output stream mute flag.
* \return 0 if not muted, 1 if muted, -1 if undefined.
...
...
src/libvlccore.sym
View file @
0c788078
...
...
@@ -17,6 +17,7 @@ aout_FormatPrint
aout_FormatPrintChannels
aout_VolumeGet
aout_VolumeSet
aout_VolumeUpdate
aout_MuteSet
aout_MuteGet
aout_DeviceGet
...
...
src/playlist/aout.c
View file @
0c788078
...
...
@@ -78,26 +78,10 @@ int playlist_VolumeUp (playlist_t *pl, int value, float *volp)
{
int
ret
=
-
1
;
float
stepSize
=
var_InheritFloat
(
pl
,
"volume-step"
)
/
(
float
)
AOUT_VOLUME_DEFAULT
;
float
delta
=
value
*
stepSize
;
audio_output_t
*
aout
=
playlist_GetAout
(
pl
);
if
(
aout
!=
NULL
)
{
float
vol
=
aout_VolumeGet
(
aout
);
if
(
vol
>=
0
.
f
)
{
vol
+=
delta
;
if
(
vol
<
0
.
f
)
vol
=
0
.
f
;
if
(
vol
>
2
.
f
)
vol
=
2
.
f
;
vol
=
(
roundf
(
vol
/
stepSize
))
*
stepSize
;
if
(
volp
!=
NULL
)
*
volp
=
vol
;
ret
=
aout_VolumeSet
(
aout
,
vol
);
}
ret
=
aout_VolumeUpdate
(
aout
,
value
,
volp
);
vlc_object_release
(
aout
);
}
return
ret
;
...
...
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