diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-08-21 02:56:17 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-08-21 02:56:17 +0200 |
commit | 9f97b7cbe13b3a4f0fefd8588a3dec95f0d14e58 (patch) | |
tree | 2711054052bc42f2f5d0d56ddc852582b45e78c6 /src/pulsecore/sink.c | |
parent | 52e5d4b1d24db4f4f9ff6e70ddf8c9a6b80cdc6a (diff) |
sink-input: add callbacks that are called whenever the mute/volume changes
Diffstat (limited to 'src/pulsecore/sink.c')
-rw-r--r-- | src/pulsecore/sink.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index 1cce8e6b..fab88755 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -1380,9 +1380,14 @@ static void propagate_reference_volume(pa_sink *s) { pa_cvolume_remap(&remapped, &s->channel_map, &i->channel_map); pa_sw_cvolume_multiply(&i->volume, &remapped, &i->reference_ratio); - /* The reference volume changed, let's tell people so */ - if (!pa_cvolume_equal(&old_volume, &i->volume)) + /* The volume changed, let's tell people so */ + if (!pa_cvolume_equal(&old_volume, &i->volume)) { + + if (i->volume_changed) + i->volume_changed(i); + pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index); + } } } @@ -1522,8 +1527,13 @@ static void propagate_real_volume(pa_sink *s, const pa_cvolume *old_real_volume) pa_sw_cvolume_multiply(&i->volume, &remapped, &i->reference_ratio); /* Notify if something changed */ - if (!pa_cvolume_equal(&old_volume, &i->volume)) + if (!pa_cvolume_equal(&old_volume, &i->volume)) { + + if (i->volume_changed) + i->volume_changed(i); + pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index); + } } } |