This is useful for the next commit because the stream list will be moved
in a separate window and to do that we need an always-updated list of
the playing streams. Without this approach, we would lose all the
streams that played before the user opens the stream list window. Also,
this allows us to decuple data and UI, which is definitely not a bad
thing.
The libcanberra event-sound-cache that stores the resolved paths for
sound names can get stuck with the fallback sound (bell) after trying to
play an invalid symlink, such as can happen after updating to 43 which
removed some sounds which might have been selected as alert sounds
before.
Neither changing the symlink nor touching the theme directory seems to
invalidate that cache, but touching the sounds directory does.
This now updates the sounds directory mtime before triggering purging
the sound sample cache in the sound server via g-s-d so libcanberra will
load the correct sounds when repopulating the sample cache afterwards.
Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2277
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.
The `X-GNOME-Bugzilla-*` entries were for use by bug-buddy, a GNOME 2
technology that's been gone for over a decade. These entries are
obsolete and can be removed from all desktop files.
The `X-GNOME-Settings-Panel` entry is also obsolete as far as I can
tell and only these panels had it in their desktop file: notifications,
sharing, sound and user-accounts. These entries can also be removed.
After removing the `X-GNOME-Bugzilla-*` entries, the desktop files have
no more variables in them. The meson `configure_file` step is therefor
pointless—there are no variables to configure. As such the
`*.desktop.in.in` files are renamed to `*.desktop.in` to reflect this
and `meson.build` files are modified to remove `configure_file` step.
The sound plugin of gnome-settings-daemon which flushes the pulseaudio
sample cache does non-recursive monitoring of the sounds directory. If
the custom theme directory used for switching between bell sounds
already exists due to previous bell sound changes, subsequent changes
within that directory will not be noticed. The old bell sample will thus
remain in the cache until the next session restart. Avoid this problem
by manually updating the modification time of the directory.
The alternative solution of adding recursive monitoring to the sound
plugin would require significantly more complicated code as there is no
support for this in glib itself. Given that sound themes never really
caught on and there is an ongoing discussion of removing support for
them entirely, going with this simple solution seems like the better
choice.
Fixes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/681
The sound alert buttons are grouped GtkToggleButtons, and for some
reason they won't get activated in the right order when tapping to
the "toggled" event. Connecting to "clicked" makes the signal order
emission correctly.
Fixes#1655
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>
Rename the app-id to org.gnome.Settings since this is what
we've been calling it for many years now. Adjust all files
that derive from the app-id, such as the desktop file, D-Bus
service file names, search providers, GSettings schemas, to
match that.
Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/344
Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0.
panels/applications/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/background/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/camera/meson.build:10:5: ERROR: Function does not take positional arguments.
[...]
In the ubuntu 20.04, we met an issue about the output volume-slider
on the machine with the legacy HDA audio driver, the output device
is the Speaker first (analog-stereo pa sink), then we connect a hdmi
monitor, the HDMI audio is in the output combo-box, we select the
hdmi audio (hdmi-stereo pa sink) from the combo-box, the hdmi audio
becomes the active output device now, we adjust the output volume from
the volume-slider, the slider UI is changed, but the output sound
is not changed with the UI.
The root cause is when the speaker is active, the pulseaudio only
keeps the analog-stereo sink, the sink hdmi-stereo is unlinked, when
users select the hdmi audio from UI, the pulseaudio will unlink
analo-stereo sink and create hdmi-stereo sink, but before hdmi-stereo
is created, the output_device_changed_cb() is called and
gvc_mixer_control_get_stream_from_device() returns a NULL since the
hdmi-stereo sink is not created yet in the pulseaudio. Because stream
is NULL, the output_volume_slider->stream is NULL, users can't change
the output volume via the volume-slider.
To fix it, we add a output_volume_slider->stream check in the
device_update_cb(), if it is NULL, get the stream and set it to
volume-slider. In this function, the sink hdmi-stereo is created
already, so the stream is not NULL. And this change also applies to
input as well.
Signed-off-by: Hui Wang <hui.wang@canonical.com>
The icon on the mute button needs to be updated whenever the volume is
changed (externally). Add the appropriate call too notify_volume_cb.
Fixes: #1268
If changed externally at least, the volume can be zero while unmuted.
Just use the lowest volume icon in that case by including it in the
range.
It does not make sense to use the muted icon, as we are not technically
muted and the toggle button is not active.
In the ubuntu 20.04, we found a regression on HDMI audio. We plug a
HDMI/DP monitor, the output device is the speaker in the output device
combo box, then we select the HDMI from the combo box, the output
device is switched to HDMI audio successfully, but the configuration
box is empty. This will not happen in the ubuntu 18.04, the profile
will show hdmi-stereo in this situation. So I think this is a
regression.
When problem happens, I could see the errors from log:
Gvc: DEBUG: Matching profile for 'output:analog-stereo' is '(null)'
Gvc: DEBUG: Matching profile for 'output:analog-stereo' is '(null)'
Gvc: DEBUG: Matching profile for 'output:analog-stereo' is '(null)'
Through debugging, I found the cc_profile_combo_box_set_device() is
called too early. In the ubuntu 18.04, this function is called after
pulseaudio changes the active_profile, but in the ubuntu 20.04, it is
called ahead of pulseaudio changes the active_profile.
To fix it, add a signal callback function, after pulseaudio changes
the active_profile, this callback function will be called, then call
cc_profile_combo_box_set_device().
Signed-off-by: Hui Wang <hui.wang@canonical.com>