From b43a45d1847f2eff096cc69f70efedd2b94c3aaa Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 19 Jan 2009 22:02:28 +0100 Subject: allow setting properties for modules, too --- src/pulse/introspect.c | 7 ++++++- src/pulse/introspect.h | 1 + src/pulse/proplist.h | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/pulse') diff --git a/src/pulse/introspect.c b/src/pulse/introspect.c index bdc50e29..e7fa6d76 100644 --- a/src/pulse/introspect.c +++ b/src/pulse/introspect.c @@ -480,13 +480,16 @@ static void context_get_module_info_callback(pa_pdispatch *pd, uint32_t command, while (!pa_tagstruct_eof(t)) { pa_module_info i; pa_bool_t auto_unload = FALSE; + memset(&i, 0, sizeof(i)); + i.proplist = pa_proplist_new(); if (pa_tagstruct_getu32(t, &i.index) < 0 || pa_tagstruct_gets(t, &i.name) < 0 || pa_tagstruct_gets(t, &i.argument) < 0 || pa_tagstruct_getu32(t, &i.n_used) < 0 || - pa_tagstruct_get_boolean(t, &auto_unload) < 0) { + (o->context->version < 15 && pa_tagstruct_get_boolean(t, &auto_unload) < 0) || + (o->context->version >= 15 && pa_tagstruct_get_proplist(t, i.proplist) < 0)) { pa_context_fail(o->context, PA_ERR_PROTOCOL); goto finish; } @@ -497,6 +500,8 @@ static void context_get_module_info_callback(pa_pdispatch *pd, uint32_t command, pa_module_info_cb_t cb = (pa_module_info_cb_t) o->callback; cb(o->context, &i, 0, o->userdata); } + + pa_proplist_free(i.proplist); } } diff --git a/src/pulse/introspect.h b/src/pulse/introspect.h index ae9bd5bc..428826e6 100644 --- a/src/pulse/introspect.h +++ b/src/pulse/introspect.h @@ -333,6 +333,7 @@ typedef struct pa_module_info { /** \cond fulldocs */ int auto_unload; /**< \deprecated Non-zero if this is an autoloaded module */ /** \endcond */ + pa_proplist *proplist; /**< Property list \since 0.9.15 */ } pa_module_info; /** Callback prototype for pa_context_get_module_info() and firends*/ diff --git a/src/pulse/proplist.h b/src/pulse/proplist.h index 8f44df27..529871f8 100644 --- a/src/pulse/proplist.h +++ b/src/pulse/proplist.h @@ -128,6 +128,10 @@ PA_C_DECL_BEGIN #define PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE "device.buffering.fragment_size" #define PA_PROP_DEVICE_PROFILE_NAME "device.profile.name" #define PA_PROP_DEVICE_PROFILE_DESCRIPTION "device.profile.description" +#define PA_PROP_MODULE_AUTHOR "module.author" +#define PA_PROP_MODULE_DESCRIPTION "module.description" +#define PA_PROP_MODULE_USAGE "module.usage" +#define PA_PROP_MODULE_VERSION "module.version" /** A property list object. Basically a dictionary with UTF-8 strings * as keys and arbitrary data as values. \since 0.9.11 */ -- cgit