[pulseaudio-discuss] [RFC v0 2/5] cli: Show card profile availability status
Mikel Astiz
mikel.astiz.oss at gmail.com
Wed Feb 13 05:48:13 PST 2013
From: Mikel Astiz <mikel.astiz at bmw-carit.de>
Expose the newly added card profile availability in pacmd.
---
src/pulsecore/cli-text.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
index 238fbd8..76adf82 100644
--- a/src/pulsecore/cli-text.c
+++ b/src/pulsecore/cli-text.c
@@ -116,6 +116,19 @@ static const char *port_available_to_string(pa_port_available_t a) {
}
}
+static const char *profile_available_to_string(pa_profile_available_t a) {
+ switch (a) {
+ case PA_PROFILE_AVAILABLE_UNKNOWN:
+ return "unknown";
+ case PA_PROFILE_AVAILABLE_NO:
+ return "no";
+ case PA_PROFILE_AVAILABLE_YES:
+ return "yes";
+ default:
+ return "invalid"; /* Should never happen! */
+ }
+}
+
static void append_port_list(pa_strbuf *s, pa_hashmap *ports)
{
pa_device_port *p;
@@ -173,7 +186,8 @@ char *pa_card_list_to_string(pa_core *c) {
pa_strbuf_puts(s, "\tprofiles:\n");
PA_HASHMAP_FOREACH(profile, card->profiles, state)
- pa_strbuf_printf(s, "\t\t%s: %s (priority %u)\n", profile->name, profile->description, profile->priority);
+ pa_strbuf_printf(s, "\t\t%s: %s (priority %u, available: %s)\n", profile->name, profile->description,
+ profile->priority, profile_available_to_string(profile->available));
pa_strbuf_printf(
s,
--
1.8.1
More information about the pulseaudio-discuss
mailing list