device-port: introduce available_group member

In some cases, the I/O connector functionality can be shared
and we cannot determine the proper purpose automatically.
We just know that something was inserted to the jack.

Introduce a group identifier (a simple string - unique
per group) which helps to determine the proper ports
for the application. The user interface may be used
to set the wanted behaviour.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2020-04-14 17:42:34 +02:00 committed by Tanu Kaskinen
parent 9315bbdfe5
commit 861836c5f7
7 changed files with 54 additions and 8 deletions

View file

@ -46,6 +46,7 @@ struct pa_device_port {
unsigned priority;
pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */
char *available_group; /* a string indentifier which determine the group of devices handling the available state simulteneously */
pa_proplist *proplist;
pa_hashmap *profiles; /* Does not own the profiles */
@ -67,6 +68,7 @@ typedef struct pa_device_port_new_data {
char *name;
char *description;
pa_available_t available;
char *available_group;
pa_direction_t direction;
} pa_device_port_new_data;
@ -74,6 +76,7 @@ pa_device_port_new_data *pa_device_port_new_data_init(pa_device_port_new_data *d
void pa_device_port_new_data_set_name(pa_device_port_new_data *data, const char *name);
void pa_device_port_new_data_set_description(pa_device_port_new_data *data, const char *description);
void pa_device_port_new_data_set_available(pa_device_port_new_data *data, pa_available_t available);
void pa_device_port_new_data_set_available_group(pa_device_port_new_data *data, const char *group);
void pa_device_port_new_data_set_direction(pa_device_port_new_data *data, pa_direction_t direction);
void pa_device_port_new_data_done(pa_device_port_new_data *data);