Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
316a25de
Commit
316a25de
authored
Dec 22, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Volume: add constant PCM_VOLUME_BITS
parent
bfe020e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
PcmVolume.cxx
src/pcm/PcmVolume.cxx
+1
-1
PcmVolume.hxx
src/pcm/PcmVolume.hxx
+5
-0
No files found.
src/pcm/PcmVolume.cxx
View file @
316a25de
...
@@ -37,7 +37,7 @@ pcm_volume_change(typename Traits::pointer_type buffer,
...
@@ -37,7 +37,7 @@ pcm_volume_change(typename Traits::pointer_type buffer,
sample
=
(
sample
*
volume
+
pcm_volume_dither
()
+
sample
=
(
sample
*
volume
+
pcm_volume_dither
()
+
PCM_VOLUME_1S
/
2
)
PCM_VOLUME_1S
/
2
)
/
PCM_VOLUME_1
S
;
>>
PCM_VOLUME_BIT
S
;
*
buffer
++
=
PcmClamp
<
F
,
Traits
>
(
sample
);
*
buffer
++
=
PcmClamp
<
F
,
Traits
>
(
sample
);
}
}
...
...
src/pcm/PcmVolume.hxx
View file @
316a25de
...
@@ -27,6 +27,11 @@
...
@@ -27,6 +27,11 @@
#include <stddef.h>
#include <stddef.h>
/**
/**
* Number of fractional bits for a fixed-point volume value.
*/
static
constexpr
unsigned
PCM_VOLUME_BITS
=
10
;
/**
* This value means "100% volume".
* This value means "100% volume".
*/
*/
static
constexpr
unsigned
PCM_VOLUME_1
=
1024
;
static
constexpr
unsigned
PCM_VOLUME_1
=
1024
;
...
...
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