"Availability group" is more clear about what the field is about.
Credits to Arun Raghavan for coming up with the better name.
New fields in the port introspection data (duplicated for all port types:
sink, source and card ports):
- string available_group
+ string availability_group
uint32 type
#### If you just changed the protocol, read this
}
pa_proplist_free(p->proplist);
- pa_xfree(p->available_group);
+ pa_xfree(p->availability_group);
pa_xfree(p->name);
pa_xfree(p->description);
pa_xfree(p->description_key);
}
/* the logic is simple: if we see the jack in multiple paths */
-/* assign all those jacks to one available_group */
+/* assign all those jacks to one availability_group */
static void mapping_group_available(pa_hashmap *paths)
{
void *state, *state2;
if (pa_streq(j->name, j2->name)) {
j->state_plugged = PA_AVAILABLE_UNKNOWN;
j2->state_plugged = PA_AVAILABLE_UNKNOWN;
- found = p2->available_group;
+ found = p2->availability_group;
break;
}
}
if (!has_control)
continue;
if (!found) {
- p->available_group = pa_sprintf_malloc("Legacy %d", num);
+ p->availability_group = pa_sprintf_malloc("Legacy %d", num);
} else {
- p->available_group = pa_xstrdup(found);
+ p->availability_group = pa_xstrdup(found);
}
if (!found)
num++;
pa_device_port_new_data_set_description(&port_data, description);
pa_device_port_new_data_set_direction(&port_data, path->direction == PA_ALSA_DIRECTION_OUTPUT ? PA_DIRECTION_OUTPUT : PA_DIRECTION_INPUT);
pa_device_port_new_data_set_type(&port_data, path->device_port_type);
- pa_device_port_new_data_set_available_group(&port_data, path->available_group);
+ pa_device_port_new_data_set_availability_group(&port_data, path->availability_group);
p = pa_device_port_new(core, &port_data, sizeof(pa_alsa_port_data));
pa_device_port_new_data_done(&port_data);
char *name;
char *description_key;
char *description;
- char *available_group;
+ char *availability_group;
pa_device_port_type_t device_port_type;
unsigned priority;
bool autodetect_eld_device;
pa_device_port_new_data_set_type(&port_data, type);
pa_device_port_new_data_set_direction(&port_data, is_sink ? PA_DIRECTION_OUTPUT : PA_DIRECTION_INPUT);
if (jack)
- pa_device_port_new_data_set_available_group(&port_data, jack->name);
+ pa_device_port_new_data_set_availability_group(&port_data, jack->name);
port = pa_device_port_new(core, &port_data, sizeof(pa_alsa_ucm_port_data));
pa_device_port_new_data_done(&port_data);
return -PA_ERR_PROTOCOL;
}
if (u->version >= 34 &&
- (pa_tagstruct_gets(t, &s) < 0 || /* available_group */
+ (pa_tagstruct_gets(t, &s) < 0 || /* availability group */
pa_tagstruct_getu32(t, &priority) < 0)) { /* device port type */
pa_log("Parse failure");
return -PA_ERR_PROTOCOL;
goto fail;
i.ports[j]->available = av;
}
- i.ports[j]->available_group = NULL;
+ i.ports[j]->availability_group = NULL;
i.ports[j]->type = PA_DEVICE_PORT_TYPE_UNKNOWN;
if (o->context->version >= 34) {
- if (pa_tagstruct_gets(t, &i.ports[j]->available_group) < 0 ||
+ if (pa_tagstruct_gets(t, &i.ports[j]->availability_group) < 0 ||
pa_tagstruct_getu32(t, &i.ports[j]->type) < 0)
goto fail;
}
goto fail;
i.ports[j]->available = av;
}
- i.ports[j]->available_group = NULL;
+ i.ports[j]->availability_group = NULL;
i.ports[j]->type = PA_DEVICE_PORT_TYPE_UNKNOWN;
if (o->context->version >= 34) {
- if (pa_tagstruct_gets(t, &i.ports[j]->available_group) < 0 ||
+ if (pa_tagstruct_gets(t, &i.ports[j]->availability_group) < 0 ||
pa_tagstruct_getu32(t, &i.ports[j]->type))
goto fail;
}
port->type = PA_DEVICE_PORT_TYPE_UNKNOWN;
if (context->version >= 34) {
- if (pa_tagstruct_gets(t, &port->available_group) < 0 ||
+ if (pa_tagstruct_gets(t, &port->availability_group) < 0 ||
pa_tagstruct_getu32(t, &port->type) < 0)
return -PA_ERR_PROTOCOL;
} else
- port->available_group = NULL;
+ port->availability_group = NULL;
}
return 0;
const char *description; /**< Description of this port */
uint32_t priority; /**< The higher this value is, the more useful this port is as a default. */
int available; /**< A flags (see #pa_port_available), indicating availability status of this port. \since 2.0 */
- const char *available_group; /**< An indentifier for the group of ports that share their availability status with
+ const char *availability_group; /**< An indentifier for the group of ports that share their availability status with
* each other. This is meant especially for handling cases where one 3.5 mm connector
* is used for headphones, headsets and microphones, and the hardware can only tell
* that something was plugged in but not what exactly. In this situation the ports for
* all those devices share their availability status, and PulseAudio can't tell which
* one is actually plugged in, and some application may ask the user what was plugged
* in. Such applications should get a list of all card ports and compare their
- * `available_group` fields. Ports that have the same group are those that need
+ * `availability_group` fields. Ports that have the same group are those that need
* input from the user to determine which device was plugged in. The application should
* then activate the user-chosen port.
*
const char *description; /**< Description of this port */
uint32_t priority; /**< The higher this value is, the more useful this port is as a default. */
int available; /**< A flags (see #pa_port_available), indicating availability status of this port. \since 2.0 */
- const char *available_group; /**< An indentifier for the group of ports that share their availability status with
+ const char *availability_group; /**< An indentifier for the group of ports that share their availability status with
* each other. This is meant especially for handling cases where one 3.5 mm connector
* is used for headphones, headsets and microphones, and the hardware can only tell
* that something was plugged in but not what exactly. In this situation the ports for
* all those devices share their availability status, and PulseAudio can't tell which
* one is actually plugged in, and some application may ask the user what was plugged
* in. Such applications should get a list of all card ports and compare their
- * `available_group` fields. Ports that have the same group are those that need
+ * `availability_group` fields. Ports that have the same group are those that need
* input from the user to determine which device was plugged in. The application should
* then activate the user-chosen port.
*
pa_proplist *proplist; /**< Property list */
int64_t latency_offset; /**< Latency offset of the port that gets added to the sink/source latency when the port is active. \since 3.0 */
pa_card_profile_info2** profiles2; /**< Array of pointers to available profiles, or NULL. Array is terminated by an entry set to NULL. \since 5.0 */
- const char *available_group; /**< An indentifier for the group of ports that share their availability status with
+ const char *availability_group; /**< An indentifier for the group of ports that share their availability status with
* each other. This is meant especially for handling cases where one 3.5 mm connector
* is used for headphones, headsets and microphones, and the hardware can only tell
* that something was plugged in but not what exactly. In this situation the ports for
* all those devices share their availability status, and PulseAudio can't tell which
* one is actually plugged in, and some application may ask the user what was plugged
* in. Such applications should get a list of all card ports and compare their
- * `available_group` fields. Ports that have the same group are those that need
+ * `availability_group` fields. Ports that have the same group are those that need
* input from the user to determine which device was plugged in. The application should
* then activate the user-chosen port.
*
data->available = 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_availability_group(pa_device_port_new_data *data, const char *group) {
pa_assert(data);
- pa_xfree(data->available_group);
- data->available_group = pa_xstrdup(group);
+ pa_xfree(data->availability_group);
+ data->availability_group = pa_xstrdup(group);
}
void pa_device_port_new_data_set_direction(pa_device_port_new_data *data, pa_direction_t direction) {
pa_xfree(data->name);
pa_xfree(data->description);
- pa_xfree(data->available_group);
+ pa_xfree(data->availability_group);
}
void pa_device_port_set_preferred_profile(pa_device_port *p, const char *new_pp) {
if (p->profiles)
pa_hashmap_free(p->profiles);
- pa_xfree(p->available_group);
+ pa_xfree(p->availability_group);
pa_xfree(p->preferred_profile);
pa_xfree(p->name);
pa_xfree(p->description);
p->card = NULL;
p->priority = 0;
p->available = data->available;
- p->available_group = data->available_group;
- data->available_group = NULL;
+ p->availability_group = data->availability_group;
+ data->availability_group = NULL;
p->profiles = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
p->direction = data->direction;
p->type = data->type;
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 */
+ char *availability_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 */
char *name;
char *description;
pa_available_t available;
- char *available_group;
+ char *availability_group;
pa_direction_t direction;
pa_device_port_type_t type;
} pa_device_port_new_data;
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_availability_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_set_type(pa_device_port_new_data *data, pa_device_port_type_t type);
void pa_device_port_new_data_done(pa_device_port_new_data *data);
if (c->version >= 24) {
pa_tagstruct_putu32(t, p->available);
if (c->version >= 34) {
- pa_tagstruct_puts(t, p->available_group);
+ pa_tagstruct_puts(t, p->availability_group);
pa_tagstruct_putu32(t, p->type);
}
}
if (c->version >= 24) {
pa_tagstruct_putu32(t, p->available);
if (c->version >= 34) {
- pa_tagstruct_puts(t, p->available_group);
+ pa_tagstruct_puts(t, p->availability_group);
pa_tagstruct_putu32(t, p->type);
}
}
if (c->version >= 27) {
pa_tagstruct_puts64(t, port->latency_offset);
if (c->version >= 34) {
- pa_tagstruct_puts(t, port->available_group);
+ pa_tagstruct_puts(t, port->availability_group);
pa_tagstruct_putu32(t, port->type);
}
}
for (p = i->ports; *p; p++)
printf(_("\t\t%s: %s (type: %s, priority: %u%s%s%s)\n"),
(*p)->name, (*p)->description, get_device_port_type((*p)->type),
- (*p)->priority, (*p)->available_group ? _(", available group: ") : "",
- (*p)->available_group ?: "", get_available_str_ynonly((*p)->available));
+ (*p)->priority, (*p)->availability_group ? _(", availability group: ") : "",
+ (*p)->availability_group ?: "", get_available_str_ynonly((*p)->available));
}
if (i->active_port)
for (p = i->ports; *p; p++)
printf(_("\t\t%s: %s (type: %s, priority: %u%s%s%s)\n"),
(*p)->name, (*p)->description, get_device_port_type((*p)->type),
- (*p)->priority, (*p)->available_group ? _(", available group: ") : "",
- (*p)->available_group ?: "", get_available_str_ynonly((*p)->available));
+ (*p)->priority, (*p)->availability_group ? _(", availability group: ") : "",
+ (*p)->availability_group ?: "", get_available_str_ynonly((*p)->available));
}
if (i->active_port)
pa_card_profile_info **pr = (*p)->profiles;
printf(_("\t\t%s: %s (type: %s, priority: %u, latency offset: %" PRId64 " usec%s%s%s)\n"), (*p)->name,
(*p)->description, get_device_port_type((*p)->type), (*p)->priority, (*p)->latency_offset,
- (*p)->available_group ? _(", available group: ") : "", (*p)->available_group ?: "",
+ (*p)->availability_group ? _(", availability group: ") : "", (*p)->availability_group ?: "",
get_available_str_ynonly((*p)->available));
if (!pa_proplist_isempty((*p)->proplist)) {