summaryrefslogtreecommitdiffstats
path: root/src/modules/raop
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-19 02:55:02 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-19 02:55:02 +0200
commit8c31974f56ebbbfc1a4978150026acf77c32689e (patch)
tree3078845a45638377a5d181695ed352dd32bf44cb /src/modules/raop
parent5207e191424675df74059aaf30f9b1292a05cb5d (diff)
sink: volume handling rework, new flat volume logic
- We now implement a logic where the sink maintains two distinct volumes: the 'reference' volume which is shown to the users, and the 'real' volume, which is configured to the hardware. The latter is configured to the max of all streams. Volume changes on sinks are propagated back to the streams proportional to the reference volume change. Volume changes on sink inputs are forwarded to the sink by 'pushing' the volume if necessary. This renames the old 'virtual_volume' to 'real_volume'. The 'reference_volume' is now the one exposed to users. By this logic the sink volume visible to the user, will always be the "upper" boundary for everything that is played. Saved/restored stream volumes are measured relative to this boundary, the factor here is always < 1.0. - introduce accuracy for sink volumes, similar to the accuracy we already have for source volumes. - other cleanups.
Diffstat (limited to 'src/modules/raop')
-rw-r--r--src/modules/raop/module-raop-sink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/raop/module-raop-sink.c b/src/modules/raop/module-raop-sink.c
index 9699132d..ac48ab10 100644
--- a/src/modules/raop/module-raop-sink.c
+++ b/src/modules/raop/module-raop-sink.c
@@ -283,15 +283,15 @@ static void sink_set_volume_cb(pa_sink *s) {
/* Calculate the max volume of all channels.
We'll use this as our (single) volume on the APEX device and emulate
any variation in channel volumes in software */
- v = pa_cvolume_max(&s->virtual_volume);
+ v = pa_cvolume_max(&s->real_volume);
/* Create a pa_cvolume version of our single value */
pa_cvolume_set(&hw, s->sample_spec.channels, v);
/* Perform any software manipulation of the volume needed */
- pa_sw_cvolume_divide(&s->soft_volume, &s->virtual_volume, &hw);
+ pa_sw_cvolume_divide(&s->soft_volume, &s->real_volume, &hw);
- pa_log_debug("Requested volume: %s", pa_cvolume_snprint(t, sizeof(t), &s->virtual_volume));
+ pa_log_debug("Requested volume: %s", pa_cvolume_snprint(t, sizeof(t), &s->real_volume));
pa_log_debug("Got hardware volume: %s", pa_cvolume_snprint(t, sizeof(t), &hw));
pa_log_debug("Calculated software volume: %s", pa_cvolume_snprint(t, sizeof(t), &s->soft_volume));