From a94ae3f20f04016e5968aeb2fc80fd474fd9ce04 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= Date: Mon, 13 Aug 2018 12:19:41 -0700 Subject: [PATCH] card: Create pa_available_to_string Add a new function to the card API that returns the string representation of a pa_available_t variable. --- src/pulsecore/card.c | 13 +++++++++++++ src/pulsecore/card.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c index bc5b75b..4305eb4 100644 --- a/src/pulsecore/card.c +++ b/src/pulsecore/card.c @@ -36,6 +36,19 @@ #include "card.h" +const char *pa_available_to_string(pa_available_t available) { + switch (available) { + case PA_AVAILABLE_UNKNOWN: + return "unknown"; + case PA_AVAILABLE_NO: + return "no"; + case PA_AVAILABLE_YES: + return "yes"; + default: + pa_assert_not_reached(); + } +} + pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra) { pa_card_profile *c; diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h index 09284f6..a11e33d 100644 --- a/src/pulsecore/card.h +++ b/src/pulsecore/card.h @@ -113,6 +113,8 @@ typedef struct { pa_direction_t direction; } pa_card_preferred_port_changed_hook_data; +const char *pa_available_to_string(pa_available_t available); + pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra); void pa_card_profile_free(pa_card_profile *c); -- 2.7.4