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

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Tue Apr 15 03:56:13 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 849c448..6855295 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -3803,4 +3803,5 @@ void pa_sink_set_reference_volume_direct(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);
 }
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index cc73b99..e99db79 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -2871,4 +2871,5 @@ void pa_source_set_reference_volume_direct(pa_source *s, const pa_cvolume *volum
                                             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);
 }
-- 
1.8.3.1



More information about the pulseaudio-discuss mailing list