[pulseaudio-discuss] [PATCH 3/4] sink, source: Add hooks for volume changes

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Mon Apr 7 05:24:18 PDT 2014


---
 src/pulsecore/core.h   | 2 ++
 src/pulsecore/sink.c   | 1 +
 src/pulsecore/source.c | 1 +
 3 files changed, 4 insertions(+)

diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index f268e42..d764ac4 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -76,6 +76,7 @@ typedef enum pa_core_hook {
     PA_CORE_HOOK_SINK_PROPLIST_CHANGED,
     PA_CORE_HOOK_SINK_PORT_CHANGED,
     PA_CORE_HOOK_SINK_FLAGS_CHANGED,
+    PA_CORE_HOOK_SINK_VOLUME_CHANGED,
     PA_CORE_HOOK_SOURCE_NEW,
     PA_CORE_HOOK_SOURCE_FIXATE,
     PA_CORE_HOOK_SOURCE_PUT,
@@ -85,6 +86,7 @@ typedef enum pa_core_hook {
     PA_CORE_HOOK_SOURCE_PROPLIST_CHANGED,
     PA_CORE_HOOK_SOURCE_PORT_CHANGED,
     PA_CORE_HOOK_SOURCE_FLAGS_CHANGED,
+    PA_CORE_HOOK_SOURCE_VOLUME_CHANGED,
     PA_CORE_HOOK_SINK_INPUT_NEW,
     PA_CORE_HOOK_SINK_INPUT_FIXATE,
     PA_CORE_HOOK_SINK_INPUT_PUT,
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index a0e46c5..52dd88a 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1940,6 +1940,7 @@ static void set_reference_volume_internal(pa_sink *s, const pa_cvolume *volume)
                                             s->flags & PA_SINK_DECIBEL_VOLUME));
 
     pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
+    pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SINK_VOLUME_CHANGED], s);
 }
 
 /* Called from main thread. Only called for the root sink in volume sharing
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 5323ce7..a05c8cb 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -1534,6 +1534,7 @@ static void set_reference_volume_internal(pa_source *s, const pa_cvolume *volume
                                             s->flags & PA_SOURCE_DECIBEL_VOLUME));
 
     pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
+    pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SOURCE_VOLUME_CHANGED], s);
 }
 
 /* Called from main thread. Only called for the root source in volume sharing
-- 
1.8.3.1



More information about the pulseaudio-discuss mailing list