summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-04-15 13:56:15 +0300
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-05-02 16:00:56 +0300
commit2f6364dfe454d3fe21cf98854ac8942870e52436 (patch)
treefbdd6887606fe16be3ba9e776da569df985aac9b
parent415dd6306a43ca7b2956f1a843012ba9e941d322 (diff)
sink, source: Add hooks for mute changes
-rw-r--r--src/pulsecore/core.h2
-rw-r--r--src/pulsecore/sink.c1
-rw-r--r--src/pulsecore/source.c1
3 files changed, 4 insertions, 0 deletions
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index 2276fb95b..762157efa 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -77,6 +77,7 @@ typedef enum pa_core_hook {
PA_CORE_HOOK_SINK_PORT_CHANGED,
PA_CORE_HOOK_SINK_FLAGS_CHANGED,
PA_CORE_HOOK_SINK_VOLUME_CHANGED,
+ PA_CORE_HOOK_SINK_MUTE_CHANGED,
PA_CORE_HOOK_SOURCE_NEW,
PA_CORE_HOOK_SOURCE_FIXATE,
PA_CORE_HOOK_SOURCE_PUT,
@@ -87,6 +88,7 @@ typedef enum pa_core_hook {
PA_CORE_HOOK_SOURCE_PORT_CHANGED,
PA_CORE_HOOK_SOURCE_FLAGS_CHANGED,
PA_CORE_HOOK_SOURCE_VOLUME_CHANGED,
+ PA_CORE_HOOK_SOURCE_MUTE_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 d071c30c8..fbb14d278 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -2219,6 +2219,7 @@ void pa_sink_set_mute(pa_sink *s, bool mute, bool save) {
pa_log_debug("The mute of sink %s changed from %s to %s.", s->name, pa_yes_no(old_muted), pa_yes_no(mute));
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_MUTE, NULL, 0, NULL) == 0);
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_MUTE_CHANGED], s);
}
/* Called from main thread */
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index d0b73c9d9..61d42fa28 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -1812,6 +1812,7 @@ void pa_source_set_mute(pa_source *s, bool mute, bool save) {
pa_log_debug("The mute of source %s changed from %s to %s.", s->name, pa_yes_no(old_muted), pa_yes_no(mute));
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_MUTE, NULL, 0, NULL) == 0);
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_MUTE_CHANGED], s);
}
/* Called from main thread */