On Wed, 2013-02-13 at 14:48 +0100, Mikel Astiz wrote: > From: Mikel Astiz <mikel.astiz at bmw-carit.de> > > Some cards are capable to announce if a specific profile is available or > not, effectively predicting whether a profile switch would fail or would > likely succeed. This can for example be useful for a UI that would gray > out any unavailable profile. > > In addition, this information can be useful for internal modules > implementing automatic profile-switching policies, such as > module-switch-on-port-available or module-bluetooth-policy. > > In particular, this information is essential when a port is associated > to multiple card profiles and therefore the port availability flag does > not provide enough information. The port "bluetooth-output" falls into > this category, for example, since it doesn't distinguish HSP/HFP from > A2DP. > --- > src/pulse/def.h | 14 ++++++++++++++ > src/pulsecore/card.c | 20 ++++++++++++++++++++ > src/pulsecore/card.h | 4 ++++ > src/pulsecore/core.h | 1 + > 4 files changed, 39 insertions(+) > > diff --git a/src/pulse/def.h b/src/pulse/def.h > index b939319..ccac28b 100644 > --- a/src/pulse/def.h > +++ b/src/pulse/def.h > @@ -1006,6 +1006,20 @@ typedef enum pa_port_available { > > /** \endcond */ > > +/** Card profile availability > + * \since 3.1 */ IIRC, David already pointed out that this should be 4.0. > +typedef enum pa_profile_available { > + PA_PROFILE_AVAILABLE_UNKNOWN = 0, /**< This card profile does not support availability or the information is not known */ > + PA_PROFILE_AVAILABLE_NO = 1, /**< This card profile is not available, and a profile switch would fail */ > + PA_PROFILE_AVAILABLE_YES = 2, /**< This card profile is available, and a profile switch would likely succeed */ > +} pa_profile_available_t; I don't think there's any point in replicating this enum for every class that has a three-state "available" property. So, I think we should have a generic pa_available_t enumeration. -- Tanu