diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-08-11 17:53:34 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-08-11 17:53:34 +0000 |
commit | c90dd53268bec8516be3b37e8af1989290f022a2 (patch) | |
tree | a0a2f8a9dbdcc9fb975045d39a3b5d9c0f8556e3 /src/pulsecore/source.c | |
parent | 0aebc03d1ad0820dac76057a0474a4bd7c025c76 (diff) |
* introduce new functions pa_sink_set_description() and pa_source_set_description() for changing the description of a sink/source
* allow sinks without monitor sources attached
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1203 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/source.c')
-rw-r--r-- | src/pulsecore/source.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c index 48b6daea..f9c0703d 100644 --- a/src/pulsecore/source.c +++ b/src/pulsecore/source.c @@ -313,3 +313,19 @@ int pa_source_get_mute(pa_source *s, pa_mixer_t m) { } else return s->sw_muted; } + +void pa_source_set_description(pa_source *s, const char *description) { + assert(s); + assert(s->ref >= 1); + + if (!description && !s->description) + return; + + if (description && s->description && !strcmp(description, s->description)) + return; + + pa_xfree(s->description); + s->description = pa_xstrdup(description); + + pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index); +} |