From 0ef3456f6836fa8d0083e5fb9d62e85c6edbc3aa Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Fri, 2 Dec 2011 13:34:54 +0100 Subject: [PATCH] device-port: Add a property list to ports. They're not used for anything yet, but hopefully soon they'll be. Signed-off-by: David Henningsson --- src/pulsecore/cli-text.c | 6 +++++- src/pulsecore/device-port.c | 3 +++ src/pulsecore/device-port.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c index 22536359..48239242 100644 --- a/src/pulsecore/cli-text.c +++ b/src/pulsecore/cli-text.c @@ -124,9 +124,13 @@ static void append_port_list(pa_strbuf *s, pa_hashmap *ports) return; pa_strbuf_puts(s, "\tports:\n"); - PA_HASHMAP_FOREACH(p, ports, state) + PA_HASHMAP_FOREACH(p, ports, state) { + char *t = pa_proplist_to_string_sep(p->proplist, "\n\t\t\t\t"); pa_strbuf_printf(s, "\t\t%s: %s (priority %u, available: %s)\n", p->name, p->description, p->priority, port_available_to_string(p->available)); + pa_strbuf_printf(s, "\t\t\tproperties:\n\t\t\t\t%s\n", t); + pa_xfree(t); + } } char *pa_card_list_to_string(pa_core *c) { diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c index 7988649b..30fb0252 100644 --- a/src/pulsecore/device-port.c +++ b/src/pulsecore/device-port.c @@ -70,6 +70,8 @@ static void device_port_free(pa_object *o) { pa_assert(p); pa_assert(pa_device_port_refcnt(p) == 0); + if (p->proplist) + pa_proplist_free(p->proplist); if (p->profiles) pa_hashmap_free(p->profiles, NULL, NULL); pa_xfree(p->name); @@ -94,6 +96,7 @@ pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *des p->profiles = NULL; p->is_input = FALSE; p->is_output = FALSE; + p->proplist = pa_proplist_new(); return p; } diff --git a/src/pulsecore/device-port.h b/src/pulsecore/device-port.h index ee4fc3ee..4e90a624 100644 --- a/src/pulsecore/device-port.h +++ b/src/pulsecore/device-port.h @@ -47,6 +47,7 @@ struct pa_device_port { unsigned priority; pa_port_available_t available; /* PA_PORT_AVAILABLE_UNKNOWN, PA_PORT_AVAILABLE_NO or PA_PORT_AVAILABLE_YES */ + pa_proplist *proplist; pa_hashmap *profiles; /* Can be NULL. Does not own the profiles */ pa_bool_t is_input:1; pa_bool_t is_output:1; -- 2.39.2