summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2013-03-28 17:30:16 +0200
committerTanu Kaskinen <tanuk@iki.fi>2013-04-10 16:27:19 +0300
commit4126535e0eddbfc4c4b7813acdd72ba07848baa6 (patch)
treecaab4c87bfa3dfa22174bb46fb92d7928dc0cf36
parent67e4ec3489e602b9571d4109b0983086f0774592 (diff)
sink, source: Send notifications when flags change
The hooks aren't currently used, but for example, the D-Bus protocol could use them if it implemented flag change signals.
-rw-r--r--src/pulsecore/core.h2
-rw-r--r--src/pulsecore/sink.c3
-rw-r--r--src/pulsecore/source.c3
3 files changed, 8 insertions, 0 deletions
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index 533ba9e9..a8cff5c0 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -74,6 +74,7 @@ typedef enum pa_core_hook {
PA_CORE_HOOK_SINK_STATE_CHANGED,
PA_CORE_HOOK_SINK_PROPLIST_CHANGED,
PA_CORE_HOOK_SINK_PORT_CHANGED,
+ PA_CORE_HOOK_SINK_FLAGS_CHANGED,
PA_CORE_HOOK_SOURCE_NEW,
PA_CORE_HOOK_SOURCE_FIXATE,
PA_CORE_HOOK_SOURCE_PUT,
@@ -82,6 +83,7 @@ typedef enum pa_core_hook {
PA_CORE_HOOK_SOURCE_STATE_CHANGED,
PA_CORE_HOOK_SOURCE_PROPLIST_CHANGED,
PA_CORE_HOOK_SOURCE_PORT_CHANGED,
+ PA_CORE_HOOK_SOURCE_FLAGS_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 f5d4dbc6..9b4b066c 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -784,6 +784,9 @@ void pa_sink_update_flags(pa_sink *s, pa_sink_flags_t mask, pa_sink_flags_t valu
pa_log_debug("Sink %s: DYNAMIC_LATENCY flag %s.",
s->name, (s->flags & PA_SINK_DYNAMIC_LATENCY) ? "enabled" : "disabled");
+ 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_FLAGS_CHANGED], s);
+
if (s->monitor_source)
pa_source_update_flags(s->monitor_source,
((mask & PA_SINK_LATENCY) ? PA_SOURCE_LATENCY : 0) |
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 6724c4bb..c6aa5e3a 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -710,6 +710,9 @@ void pa_source_update_flags(pa_source *s, pa_source_flags_t mask, pa_source_flag
pa_log_debug("Source %s: DYNAMIC_LATENCY flag %s.",
s->name, (s->flags & PA_SOURCE_DYNAMIC_LATENCY) ? "enabled" : "disabled");
+ 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_FLAGS_CHANGED], s);
+
PA_IDXSET_FOREACH(output, s->outputs, idx) {
if (output->destination_source)
pa_source_update_flags(output->destination_source, mask, value);