Commit graph

9 commits

Author SHA1 Message Date
Marco Melorio
ea0e2cf308 sound: Remove modelines at the top of the files
They are not even correct and make GNOME Builder to use 8 space
identation by default.
2023-01-16 20:53:56 +01:00
Marco Melorio
9e85ff5547 sound: Clamp level bars to avoid overflowing
Apparently the level value is not clamped by pulseaudio/gvc, so the
level bar can overflow when the value is greater than 1.
2023-01-16 20:51:12 +01:00
Marco Melorio
5f4bfd567a sound: Make the level bars less jittery
Use Exponential Moving Average (EMA) to achieve this. The way it works
is to take the previous values in consideration by giving more weight to
the more recent ones. This makes the level bar appear more smooth and
less jittery.
2022-12-21 01:39:38 +01:00
Marco Melorio
ba4e983b97 sound: Port CcLevelbar to use a GtkLevelBar internally 2022-12-21 01:39:36 +01:00
Hui Wang
aa0adcaa36 sound: clear the value on level_bar when stream is empty
We met an Input Device level_bar display issue on a machine which has
no internal mic. At first there is no external mic plugged, so the
Input Device list is empty and level_bar is gray color, after we plug
an external mic, the level_bar has red color ripples, then we unplug
the external mic, the Input Device list changes to empty and we
expect the level_bar changes back to gray color, but some bars are
still red color.

Here clear the self->value to 0 if the stream is empty, then the
level_bar will change back to gray color when Input/Output device
list is empty.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2022-01-21 18:38:30 +00:00
Georges Basile Stavracas Neto
a719008403 sound: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
05b531ec28 sound: Remove unused variable 2019-06-16 01:01:36 +00:00
Jordan Petridis
b542e98359 sounds: Use correct mute icon in the input section
The current code does not differenciate between input and
output, and thus it shows the same icon for muting outputs
and inputs. As per design suggesion [1], the input row
should use the "microphone-sensitivity-muted-symbolic" icon.

In order to achieve that, move the CcLevelBarStreamType enum
to a separate header, and rename it to CcStreamType. And also
pass the stream type to the volume slider.

In CcVolumeSlider, update the code to switch to the correct
mute icon depending on the stream type.

[1] https://gitlab.gnome.org/GNOME/gnome-control-center/issues/539

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/539
2019-06-16 01:01:36 +00:00
Robert Ancell
0799c864e8 sound: Rename new sound panel to replace old one 2019-02-07 09:31:18 +13:00
Renamed from panels/sound-new/cc-level-bar.c (Browse further)