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>
This commit is contained in:
David Henningsson 2015-10-27 09:54:39 +01:00 committed by Tanu Kaskinen
parent 387a244cd9
commit 9fecb6eb32
6 changed files with 88 additions and 1 deletions

View file

@ -338,6 +338,11 @@ int pa_channel_map_can_balance(const pa_channel_map *map) PA_GCC_PURE;
* there are front/rear channels available. \since 0.9.15 */
int pa_channel_map_can_fade(const pa_channel_map *map) PA_GCC_PURE;
/** Returns non-zero if it makes sense to apply a volume 'lfe balance'
* (i.e.\ 'balance' between LFE and non-LFE channels) with this mapping,
* i.e.\ if there are LFE and non-LFE channels available. \since 8.0 */
int pa_channel_map_can_lfe_balance(const pa_channel_map *map) PA_GCC_PURE;
/** Tries to find a well-known channel mapping name for this channel
* mapping, i.e.\ "stereo", "surround-71" and so on. If the channel
* mapping is unknown NULL will be returned. This name can be parsed