summaryrefslogtreecommitdiff
path: root/src/pulse/channelmap.c
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2015-10-27 09:54:39 +0100
committerTanu Kaskinen <tanuk@iki.fi>2015-10-30 09:13:10 +0200
commit9fecb6eb32d19b5f2dfc194426b7b3cd678a7520 (patch)
treeea5f1b8489fb57387f513cf9b9cd8753cefae9dd /src/pulse/channelmap.c
parent387a244cd92061ecedd3cc97c6f87ece44b65a91 (diff)
downloadpulseaudio-9fecb6eb32d19b5f2dfc194426b7b3cd678a7520.tar.gz
volume: Add LFE balance API
The gnome/unity-control-center UIs have a master volume slider, and three sub-sliders: balance, fade, and subwoofer. Balance and fade use PA's set_balance and set_fade APIs accordingly, but the subwoofer slider sometimes does unintuitive things. In order to make that slider behave better, let's add a LFE balance API that these volume control UIs can use instead. With this API, the UI can balance between "no subwoofer" and "only subwoofer" with "equal balance" in the middle, which would make it more consistent with the behaviour of the other sliders. BugLink: https://bugzilla.gnome.org/show_bug.cgi?id=753847 Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Diffstat (limited to 'src/pulse/channelmap.c')
-rw-r--r--src/pulse/channelmap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pulse/channelmap.c b/src/pulse/channelmap.c
index c342ef63a..c44dca411 100644
--- a/src/pulse/channelmap.c
+++ b/src/pulse/channelmap.c
@@ -684,6 +684,19 @@ int pa_channel_map_can_fade(const pa_channel_map *map) {
(PA_CHANNEL_POSITION_MASK_REAR & m);
}
+int pa_channel_map_can_lfe_balance(const pa_channel_map *map) {
+ pa_channel_position_mask_t m;
+
+ pa_assert(map);
+ pa_return_val_if_fail(pa_channel_map_valid(map), 0);
+
+ m = pa_channel_map_mask(map);
+
+ return
+ (PA_CHANNEL_POSITION_MASK_LFE & m) &&
+ (PA_CHANNEL_POSITION_MASK_HFE & m);
+}
+
const char* pa_channel_map_to_name(const pa_channel_map *map) {
pa_bitset_t in_map[PA_BITSET_ELEMENTS(PA_CHANNEL_POSITION_MAX)];
unsigned c;