summaryrefslogtreecommitdiffstats
path: root/polyp/source.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-08-11 00:11:12 +0000
committerLennart Poettering <lennart@poettering.net>2004-08-11 00:11:12 +0000
commit3d374e9f678133638e661cadf73d4ef7ddcfe6eb (patch)
tree58f89c96e8e9fdbf027a407837ce1cd5f7d5e78a /polyp/source.c
parentfc618e9f316a1ec2b48a7981db41a121c79f0c27 (diff)
add subscription subsystem
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@112 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/source.c')
-rw-r--r--polyp/source.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/polyp/source.c b/polyp/source.c
index 65c90e9a..2c611651 100644
--- a/polyp/source.c
+++ b/polyp/source.c
@@ -32,6 +32,7 @@
#include "source-output.h"
#include "namereg.h"
#include "xmalloc.h"
+#include "subscribe.h"
struct pa_source* pa_source_new(struct pa_core *core, const char *name, int fail, const struct pa_sample_spec *spec) {
struct pa_source *s;
@@ -63,6 +64,8 @@ struct pa_source* pa_source_new(struct pa_core *core, const char *name, int fail
pa_sample_snprint(st, sizeof(st), spec);
fprintf(stderr, "source: created %u \"%s\" with sample spec \"%s\"\n", s->index, s->name, st);
+
+ pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_SOURCE | PA_SUBSCRIPTION_EVENT_NEW, s->index);
return s;
}
@@ -84,6 +87,8 @@ void pa_source_free(struct pa_source *s) {
fprintf(stderr, "source: freed %u \"%s\"\n", s->index, s->name);
+ pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE | PA_SUBSCRIPTION_EVENT_REMOVE, s->index);
+
pa_xfree(s->name);
pa_xfree(s->description);
pa_xfree(s);