Turns out that (contrary to what gvc has assumed so far) the profiles on a card
can actually change even after the card was created (especially with Bluetooth
devices, where BlueZ can always change the advertised profiles). This is causing
various problems right now, including a few crashes because we assume that
card->priv->profile (so the currently active profile) always has an entry in the
card->profiles list.
Fix the issue by allowing to update the profile list even after the card has been
created.
To do that we also need to introduce the necessary infrastructure to update the
profile lists on GvcMixerCardPort and GvcMixerUIDevice.
Note that we are still assuming that ports on the cards can not change. Turns
out these can also change, so we'll handle that with the next commit.
Closes: https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/issues/23
Closes: https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/issues/9
Keep track of the `GParamSpec`s of the properties. This allows us to use
`g_object_notify_by_pspec()`, which is a bit more performant than
`g_object_notify()`(as it doesn't need to take a global lock to lookup
the property name). It also prevents accidental typos in the property
name at compile time.
Also always add `G_PARAM_STATIC_STRINGS`, to prevent some unnecessary
string duplications of property name, blurb and description.
GvcMixerStream id is unsigned int and starts with 1, so we can use
0 as invalid id. This fixes build error/warning - comparison
between signed and unsigned integer expressions.
Right now, makes sure "Off" profiles are not added, because when selected,
the item will disappear and there's no way to get it back (because it
disappeared). In the long term, handling the "off" profile correctly
would be better.
https://bugzilla.gnome.org/show_bug.cgi?id=693654
This will allow to have different icons for internal audio cards
(which are flagged generically as "audio-card"), depending on which
port is in use (ie. headphones or speakers).
This requires the new icon information, which is only exported by
PulseAudio 3.0. If it's not available, we fallback to card icons
like before.
https://bugzilla.gnome.org/show_bug.cgi?id=689931