[RFC v1 3/6] cli: Show card profile availability status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/18/2013 09:10 AM, Mikel Astiz wrote:
> From: Mikel Astiz <mikel.astiz at bmw-carit.de>
>
> Expose the newly added card profile availability in pacmd.

This raises the interesting question of whether to expose the profile 
availability. As I understand it, this is mostly for internal use right 
now and that _AVAILABLE_NO (for profiles) is an rarely seen edge case. 
Is this correct?

As such, I think it's okay to expose in pacmd, but until we have a real 
use case, we shouldn't make it part of the protocol and client API. Does 
that make sense?

> ---
>   src/pulsecore/cli-text.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
> index c4e0b37..963f130 100644
> --- a/src/pulsecore/cli-text.c
> +++ b/src/pulsecore/cli-text.c
> @@ -103,7 +103,7 @@ char *pa_client_list_to_string(pa_core *c) {
>       return pa_strbuf_tostring_free(s);
>   }
>
> -static const char *port_available_to_string(pa_available_t a) {
> +static const char *available_to_string(pa_available_t a) {
>       switch (a) {
>           case PA_AVAILABLE_UNKNOWN:
>               return "unknown";
> @@ -131,7 +131,7 @@ static void append_port_list(pa_strbuf *s, pa_hashmap *ports)
>           char *t = pa_proplist_to_string_sep(p->proplist, "\n\t\t\t\t");
>           pa_strbuf_printf(s, "\t\t%s: %s (priority %u, latency offset %" PRId64 " usec, available: %s)\n",
>               p->name, p->description, p->priority, p->latency_offset,
> -            port_available_to_string(p->available));
> +            available_to_string(p->available));
>           pa_strbuf_printf(s, "\t\t\tproperties:\n\t\t\t\t%s\n", t);
>           pa_xfree(t);
>       }
> @@ -173,7 +173,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, available_to_string(profile->available));
>
>           pa_strbuf_printf(
>                   s,
>



-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux