From 3d374e9f678133638e661cadf73d4ef7ddcfe6eb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 11 Aug 2004 00:11:12 +0000 Subject: add subscription subsystem git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@112 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/sink.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'polyp/sink.c') diff --git a/polyp/sink.c b/polyp/sink.c index 9628d8bd..7e0e15cd 100644 --- a/polyp/sink.c +++ b/polyp/sink.c @@ -34,6 +34,7 @@ #include "util.h" #include "sample-util.h" #include "xmalloc.h" +#include "subscribe.h" #define MAX_MIX_CHANNELS 32 @@ -77,6 +78,8 @@ struct pa_sink* pa_sink_new(struct pa_core *core, const char *name, int fail, co pa_sample_snprint(st, sizeof(st), spec); fprintf(stderr, "sink: created %u \"%s\" with sample spec \"%s\"\n", s->index, s->name, st); + + pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_SINK | PA_SUBSCRIPTION_EVENT_NEW, s->index); return s; } @@ -98,6 +101,8 @@ void pa_sink_free(struct pa_sink *s) { pa_idxset_remove_by_data(s->core->sinks, s, NULL); fprintf(stderr, "sink: freed %u \"%s\"\n", s->index, s->name); + + pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK | PA_SUBSCRIPTION_EVENT_REMOVE, s->index); pa_xfree(s->name); pa_xfree(s->description); -- cgit