Rename "available group" to "availability group"
authorTanu Kaskinen <tanuk@iki.fi>
Wed, 17 Jun 2020 05:40:16 +0000 (08:40 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Mon, 10 Aug 2020 17:54:21 +0000 (20:54 +0300)
"Availability group" is more clear about what the field is about.
Credits to Arun Raghavan for coming up with the better name.

PROTOCOL
src/modules/alsa/alsa-mixer.c
src/modules/alsa/alsa-mixer.h
src/modules/alsa/alsa-ucm.c
src/modules/module-tunnel.c
src/pulse/introspect.c
src/pulse/introspect.h
src/pulsecore/device-port.c
src/pulsecore/device-port.h
src/pulsecore/protocol-native.c
src/utils/pactl.c

index 0b18edf..4307898 100644 (file)
--- a/PROTOCOL
+++ b/PROTOCOL
@@ -432,7 +432,7 @@ Added two values to the pa_encoding_t enum:
 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
index 758bef2..b22fba7 100644 (file)
@@ -758,7 +758,7 @@ void pa_alsa_path_free(pa_alsa_path *p) {
     }
 
     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);
@@ -4276,7 +4276,7 @@ fail:
 }
 
 /* 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;
@@ -4300,7 +4300,7 @@ static void mapping_group_available(pa_hashmap *paths)
                    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;
                    }
                }
@@ -4311,9 +4311,9 @@ static void mapping_group_available(pa_hashmap *paths)
        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++;
@@ -5173,7 +5173,7 @@ static pa_device_port* device_port_alsa_init(pa_hashmap *ports, /* card ports */
         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);
index a7d0ddc..905e312 100644 (file)
@@ -211,7 +211,7 @@ struct pa_alsa_path {
     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;
index c32d3c1..b63ae36 100644 (file)
@@ -1065,7 +1065,7 @@ static void ucm_add_port_combination(
         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);
index bb4ae48..4c384ee 100644 (file)
@@ -1040,7 +1040,7 @@ static int read_ports(struct userdata *u, pa_tagstruct *t) {
                     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;
index b19c3fd..3027f38 100644 (file)
@@ -219,10 +219,10 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
                                 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;
                         }
@@ -499,10 +499,10 @@ static void context_get_source_info_callback(pa_pdispatch *pd, uint32_t command,
                                 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;
                         }
@@ -879,11 +879,11 @@ static int fill_card_port_info(pa_context *context, pa_tagstruct* t, pa_card_inf
 
         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;
index 6575107..8fff1ac 100644 (file)
@@ -229,14 +229,14 @@ typedef struct pa_sink_port_info {
     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.
                                          *
@@ -334,14 +334,14 @@ typedef struct pa_source_port_info {
     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.
                                          *
@@ -559,14 +559,14 @@ typedef struct pa_card_port_info {
     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.
                                          *
index 416bb1a..8263c9e 100644 (file)
@@ -54,11 +54,11 @@ void pa_device_port_new_data_set_available(pa_device_port_new_data *data, pa_ava
     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) {
@@ -78,7 +78,7 @@ void pa_device_port_new_data_done(pa_device_port_new_data *data) {
 
     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) {
@@ -164,7 +164,7 @@ static void device_port_free(pa_object *o) {
     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);
@@ -190,8 +190,8 @@ pa_device_port *pa_device_port_new(pa_core *c, pa_device_port_new_data *data, si
     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;
index d75eb3c..7178ff2 100644 (file)
@@ -47,7 +47,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 */
+    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 */
@@ -69,7 +69,7 @@ typedef struct pa_device_port_new_data {
     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;
@@ -78,7 +78,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_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);
index 25bd5dd..e8559b2 100644 (file)
@@ -3208,7 +3208,7 @@ static void sink_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_sin
             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);
                 }
             }
@@ -3283,7 +3283,7 @@ static void source_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_s
             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);
                 }
             }
@@ -3371,7 +3371,7 @@ static void card_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_car
         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);
             }
         }
index 0b82921..1f9ce46 100644 (file)
@@ -363,8 +363,8 @@ static void get_sink_info_callback(pa_context *c, const pa_sink_info *i, int is_
         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)
@@ -471,8 +471,8 @@ static void get_source_info_callback(pa_context *c, const pa_source_info *i, int
         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)
@@ -635,7 +635,7 @@ static void get_card_info_callback(pa_context *c, const pa_card_info *i, int is_
             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)) {