introspect: Expose port info per card to clients

For volume control UIs to be able to show ports in inactive profiles,
expose all ports together with the card info. This includes updating
the protocol and the client API to show the connection between ports
and for which profiles the ports are relevant.

Update protocol to 26.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
David Henningsson 2012-02-23 07:17:06 +01:00 committed by Arun Raghavan
parent 752ae7285e
commit 793f46320e
7 changed files with 207 additions and 7 deletions

View file

@ -582,6 +582,25 @@ static void get_card_info_callback(pa_context *c, const pa_card_info *i, int is_
printf(_("\tActive Profile: %s\n"),
i->active_profile->name);
if (i->ports) {
pa_card_port_info **p;
printf(_("\tPorts:\n"));
for (p = i->ports; *p; p++) {
pa_card_profile_info **pr = (*p)->profiles;
printf(_("\t\t%s: %s (priority %u)\n"), (*p)->name, (*p)->description, (*p)->priority);
if (pr) {
printf(_("\t\t\tPart of profile(s): %s"), pa_strnull((*pr)->name));
pr++;
while (*pr) {
printf(", %s", pa_strnull((*pr)->name));
pr++;
}
printf("\n");
}
}
}
pa_xfree(pl);
}