Commit Graph

16 Commits

Author SHA1 Message Date
Jonas Dreßler
82fed08587 mixer-control: Update card, ui-device, and port profiles on changes
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
2024-03-12 14:38:03 +01:00
Bastien Nocera
20b130c17f mixer-ui-device: Make debug for port available useful
The debug output would print the same value twice, instead of showing
the before and after values when setting the property.
2024-02-04 00:22:37 +01:00
Bastien Nocera
c72e46fc44 mixer-ui-device: Add debug for device type and icon name 2024-02-04 00:22:37 +01:00
Niels De Graef
000046e887 mixer-ui-device: Improve GObject properties gunk a bit
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.
2023-07-18 15:52:10 +00:00
Robert Ancell
3f457453f0 Add missing guards for inputs to functions 2019-03-18 10:58:36 +13:00
Robert Ancell
b28ae07ae1 Add missing allow-none annotations 2019-03-18 10:58:36 +13:00
Guido Günther
3513d37510 gvc-mixer-ui-device: Trim additional newlines in debug output
GVC logs a lot aready. No need to make it consume more screen space
with additional newlines.
2018-12-07 15:29:16 +01:00
Alberts Muktupāvels
13a4a9a5c2 avoid deprecated g_type_class_add_private 2018-09-09 00:02:41 +03:00
Alberts Muktupāvels
b7bce32944 gvc-mixer-ui-device: make stream-id unsigned int
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.
2015-09-09 14:14:15 +03:00
Alberts Muktupāvels
26ea473077 gvc-mixer-ui-device: fix build warnings 2015-09-09 14:13:03 +03:00
Alberts Muktupāvels
7e2d239a91 remove unneeded *_class_init and *_init declarations 2015-09-09 14:13:00 +03:00
Jasper St. Pierre
e14dbe8aa6 gvc-mixer-ui-device: Fix memory leak 2013-09-04 12:58:28 -04:00
David Henningsson
ed0ec42401 ui-device: Don't add off profiles
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
2013-03-26 18:13:10 +01:00
Giovanni Campagna
74c08620b4 Add a GIcon accessor for GvcMixerUIDevices
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
2013-02-18 14:39:54 +01:00
Giovanni Campagna
a1448acc5b Fix introspection support
Fix includes, comments and parameter names so that introspection builds
without warnings.
2012-10-19 20:00:47 +02:00
Giovanni Campagna
9b6e6719d4 Initial import
Code from gnome-control-center, build system integration from gnome-shell
2012-10-19 20:00:25 +02:00