[pulseaudio-discuss] [PATCH 4/4] sink-input, source-output: Add hooks for volume changes
Tanu Kaskinen
tanu.kaskinen at linux.intel.com
Mon Apr 7 05:24:19 PDT 2014
---
src/pulsecore/core.h | 2 ++
src/pulsecore/sink-input.c | 1 +
src/pulsecore/source-output.c | 1 +
3 files changed, 4 insertions(+)
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index d764ac4..2276fb9 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -97,6 +97,7 @@ typedef enum pa_core_hook {
PA_CORE_HOOK_SINK_INPUT_MOVE_FAIL,
PA_CORE_HOOK_SINK_INPUT_STATE_CHANGED,
PA_CORE_HOOK_SINK_INPUT_PROPLIST_CHANGED,
+ PA_CORE_HOOK_SINK_INPUT_VOLUME_CHANGED,
PA_CORE_HOOK_SINK_INPUT_SEND_EVENT,
PA_CORE_HOOK_SOURCE_OUTPUT_NEW,
PA_CORE_HOOK_SOURCE_OUTPUT_FIXATE,
@@ -108,6 +109,7 @@ typedef enum pa_core_hook {
PA_CORE_HOOK_SOURCE_OUTPUT_MOVE_FAIL,
PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED,
PA_CORE_HOOK_SOURCE_OUTPUT_PROPLIST_CHANGED,
+ PA_CORE_HOOK_SOURCE_OUTPUT_VOLUME_CHANGED,
PA_CORE_HOOK_SOURCE_OUTPUT_SEND_EVENT,
PA_CORE_HOOK_CLIENT_NEW,
PA_CORE_HOOK_CLIENT_PUT,
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index d08eb5f..440a4e9 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1251,6 +1251,7 @@ static void set_volume_internal(pa_sink_input *i, const pa_cvolume *volume) {
i->volume_changed(i);
pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
+ pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_VOLUME_CHANGED], i);
}
/* Called from main context */
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 22fa6d7..358518a 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -963,6 +963,7 @@ static void set_volume_internal(pa_source_output *o, const pa_cvolume *volume) {
o->volume_changed(o);
pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
+ pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_VOLUME_CHANGED], o);
}
/* Called from main context */
--
1.8.3.1
More information about the pulseaudio-discuss
mailing list