alsa-ucm: Let profiles know their associated UCM verb

Currently each UCM verb generates one profile named the same as the
verb, meaning it's trivial to know which verb the profile belongs to.
This will be slightly harder to do when we generate multiple profiles
per UCM verb (e.g. to make use of conflicting devices).

It would still be possible to parse the profile name to get the UCM
verb, but instead let's keep track of the struct instance representing
the profile's associated verb. This also lets us remove a block of code
searching for the verb by its name.

Co-authored-by: Jaroslav Kysela <perex@perex.cz>
[Alper: Reused Jaroslav's UCM profile context changes for UCM verb
instead of combined devices.]

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
This commit is contained in:
Wim Taymans 2023-03-20 15:18:12 +01:00
parent 4d08c9ad60
commit 973fe0cb79
3 changed files with 16 additions and 14 deletions

View file

@ -354,7 +354,7 @@ struct pa_alsa_mapping {
pa_alsa_device output;
pa_alsa_device input;
/* ucm device context*/
/* ucm device context */
pa_alsa_ucm_mapping_context ucm_context;
};
@ -381,6 +381,9 @@ struct pa_alsa_profile {
pa_idxset *input_mappings;
pa_idxset *output_mappings;
/* ucm device context */
pa_alsa_ucm_profile_context ucm_context;
struct {
pa_dynarray devices;
} out;