summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-04-13 22:50:24 +0200
committerLennart Poettering <lennart@poettering.net>2009-04-13 22:56:25 +0200
commitfe8b10cc05b3b8e8633ffaff30e73a40a30c8bf8 (patch)
treed8f435ba2da3b2ea7d88a66b39a2bcc63a07b7d8 /src/pulsecore/sink.h
parent49dcf0940e6024f788eeaaf33012eb8b48c3d8ae (diff)
core: introduce new 'reference' volume for sinks
The reference volume is to be used as reference volume for stored stream volumes. Previously if a new stream was created the relative volume was taken relatively to the virtual device volume. Due to the flat volume logic this could then be fed back to the virtual device volume. Repeating the whole story over and over would result in a device volume that would go lower, and lower and lower. This patch introduces a 'reference' volume for each sink which stays unmodified by stream volume changes even if flat volumes are used. It is only modified if the sink volumes are modified directly by the user. For further explanations see http://pulseaudio.org/wiki/InternalVolumes
Diffstat (limited to 'src/pulsecore/sink.h')
-rw-r--r--src/pulsecore/sink.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index cb4697f9..352282b8 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
@@ -74,8 +74,10 @@ struct pa_sink {
pa_volume_t base_volume; /* shall be constant */
unsigned n_volume_steps; /* shall be constant */
- pa_cvolume virtual_volume; /* The volume clients are informed about */
- pa_cvolume soft_volume; /* The internal software volume we apply to all PCM data while it passes through */
+ /* Also see http://pulseaudio.org/wiki/InternalVolumes */
+ pa_cvolume virtual_volume; /* The volume clients are informed about */
+ pa_cvolume reference_volume; /* The volume taken as refernce base for relative sink input volumes */
+ pa_cvolume soft_volume; /* The internal software volume we apply to all PCM data while it passes through */
pa_bool_t muted:1;
pa_bool_t refresh_volume:1;
@@ -255,8 +257,9 @@ int pa_sink_suspend_all(pa_core *c, pa_bool_t suspend);
void pa_sink_update_flat_volume(pa_sink *s, pa_cvolume *new_volume);
void pa_sink_propagate_flat_volume(pa_sink *s);
-void pa_sink_set_volume(pa_sink *sink, const pa_cvolume *volume, pa_bool_t propagate, pa_bool_t sendmsg);
-const pa_cvolume *pa_sink_get_volume(pa_sink *sink, pa_bool_t force_refresh);
+void pa_sink_set_volume(pa_sink *sink, const pa_cvolume *volume, pa_bool_t propagate, pa_bool_t sendmsg, pa_bool_t become_reference);
+const pa_cvolume *pa_sink_get_volume(pa_sink *sink, pa_bool_t force_refresh, pa_bool_t reference);
+
void pa_sink_set_mute(pa_sink *sink, pa_bool_t mute);
pa_bool_t pa_sink_get_mute(pa_sink *sink, pa_bool_t force_refresh);