mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
acp: use flag for the Off profile
This commit is contained in:
parent
9f1d84e37c
commit
a97287351c
3 changed files with 4 additions and 3 deletions
|
|
@ -117,7 +117,7 @@ static void add_profiles(pa_card *impl)
|
||||||
ap->profile.name = ap->name = pa_xstrdup("off");
|
ap->profile.name = ap->name = pa_xstrdup("off");
|
||||||
ap->profile.description = ap->description = pa_xstrdup(_("Off"));
|
ap->profile.description = ap->description = pa_xstrdup(_("Off"));
|
||||||
ap->profile.available = ACP_AVAILABLE_YES;
|
ap->profile.available = ACP_AVAILABLE_YES;
|
||||||
ap->is_off = true;
|
ap->profile.flags = ACP_PROFILE_OFF;
|
||||||
pa_hashmap_put(impl->profiles, ap->name, ap);
|
pa_hashmap_put(impl->profiles, ap->name, ap);
|
||||||
|
|
||||||
PA_HASHMAP_FOREACH(ap, impl->profile_set->profiles, state) {
|
PA_HASHMAP_FOREACH(ap, impl->profile_set->profiles, state) {
|
||||||
|
|
@ -1047,7 +1047,8 @@ int acp_card_set_profile(struct acp_card *card, uint32_t new_index)
|
||||||
|
|
||||||
/* if UCM is available for this card then update the verb */
|
/* if UCM is available for this card then update the verb */
|
||||||
if (impl->use_ucm) {
|
if (impl->use_ucm) {
|
||||||
if ((res = pa_alsa_ucm_set_profile(&impl->ucm, impl, np->is_off ? NULL : np->profile.name,
|
if ((res = pa_alsa_ucm_set_profile(&impl->ucm, impl,
|
||||||
|
np->profile.flags & ACP_PROFILE_OFF ? NULL : np->profile.name,
|
||||||
op ? op->profile.name : NULL)) < 0) {
|
op ? op->profile.name : NULL)) < 0) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -210,6 +210,7 @@ struct acp_device {
|
||||||
struct acp_card_profile {
|
struct acp_card_profile {
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
#define ACP_PROFILE_ACTIVE (1<<0)
|
#define ACP_PROFILE_ACTIVE (1<<0)
|
||||||
|
#define ACP_PROFILE_OFF (1<<1) /* the Off profile */
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
|
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
|
||||||
|
|
@ -369,7 +369,6 @@ struct pa_alsa_profile {
|
||||||
bool supported:1;
|
bool supported:1;
|
||||||
bool fallback_input:1;
|
bool fallback_input:1;
|
||||||
bool fallback_output:1;
|
bool fallback_output:1;
|
||||||
bool is_off:1;
|
|
||||||
|
|
||||||
char **input_mapping_names;
|
char **input_mapping_names;
|
||||||
char **output_mapping_names;
|
char **output_mapping_names;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue