Commit graph

243 commits

Author SHA1 Message Date
Marco Melorio
5c07348fb9 sound: Move stream list in a separate window
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/501.
2023-01-12 13:25:27 +00:00
Marco Melorio
458d8b53a2 sound: Use a model-based approach for the stream list box
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.
2023-01-12 13:25:27 +00:00
Marco Melorio
034171a8e1 sound: Simplify icon theme check
Use the gtk_icon_theme_has_icon API which is definitely more appropriate
for this task.
2023-01-12 13:23:14 +00:00
Marco Melorio
8bf20930c2 sound: Fix custom icon for speech dispatcher not being used 2023-01-12 13:23:14 +00:00
Marco Melorio
6b726791bf sound: Stop using symbolic icons for stream rows 2023-01-12 13:23:14 +00:00
Marco Melorio
bb7fdec253 sound: Cleanup CcVolumeSlider XML 2023-01-09 21:03:41 +00:00
Marco Melorio
5c3cb3042d sound: Cleanup CcSubwooferSlider XML 2023-01-09 21:03:41 +00:00
Marco Melorio
2fee8bf0fa sound: Cleanup CcFadeSlider XML and remove marks 2023-01-09 21:03:41 +00:00
Marco Melorio
3295d2a5b3 sound: Cleanup CcBalanceSlider XML and remove marks 2023-01-09 21:03:41 +00:00
Marco Melorio
62ae77ce29 sound: Make CcVolumeSlider subclass from GtkWidget 2023-01-09 21:03:41 +00:00
Marco Melorio
a5833612b8 sound: Make CcSubwooferSlider subclass from GtkWidget 2023-01-09 21:03:41 +00:00
Marco Melorio
4ab73ad337 sound: Make CcFadeSlider subclass from GtkWidget 2023-01-09 21:03:41 +00:00
Marco Melorio
c7e14e5ee4 sound: Make CcBalanceSlider subclass from GtkWidget 2023-01-09 21:03:41 +00:00
Marco Melorio
ff151bef43 sound: Don't flip the balance and fade sliders in RTL
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1067.
2023-01-09 12:09:55 +00:00
Lukáš Tyrychtr
cb333cd59c Fix accessibility of the buttons in the test sound output dialog
They had only icons, so name them for screen readers.
2023-01-06 09:56:09 -03:00
Sebastian Keller
4f850f1b47 sound: Update sounds directory mtime when changing alert sound
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
2023-01-04 18:23:07 +00:00
Marco Melorio
efc66144a7 sound: Implement the new output test design 2022-12-21 19:29:58 +00: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
4e8924fbfd sound: Move level bars to section headers 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
Jake Dane
89443fe550 desktop: Remove obsolete Bugzilla entries
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.
2022-10-20 13:20:09 +00:00
Felipe Borges
ff904208cb sound: Fix sound alert selection
The mapping between sounds and the UI elements was wrong.

Fixes #2026
2022-08-25 16:08:24 +02:00
Jakub Steiner
9def0c98e3 sound: tweak default alert sounds
- one more review pass by the designers:
  - shorter
  - tone down reverb
  - fine tune the pan on swing
  - forceful fade out to 0 on all clips
2022-08-11 16:36:59 +02:00
Jakub Steiner
e3395b1dc3 sounds: EQ sounds
- few EQ and timing adjustments to the sounds

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/264
2022-08-11 12:20:23 +00:00
Felipe Borges
878171bd7c sound: Update sound alerts
Old sound alerts set by users will be migrated to the "click"
sound alert.

Fixes #264
2022-08-11 12:20:23 +00:00
Bilal Elmoussaoui
bb86c36147 panels: Use icon-name property instead
Don't embed a custom GtkImage as that would lack the appropriate style
classes
that GtkButton/GtkMenuButton would automatically add for us
2022-07-20 14:15:57 +02:00
Lukáš Tyrychtr
98fcce2202 Add missing a11y labels 2022-06-17 02:01:33 +00:00
Sebastian Keller
7b1af9c8ba sound: Update theme directory modification time after bell sound changes
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
2022-05-10 04:05:44 +00:00
Michael Catanzaro
62bde81c54 sound: remove dog bark sound theme
You're welcome, internet.
2022-04-26 15:22:05 -03:00
Felipe Borges
28edca0f16 sound: Connect to "clicked" signal for the sound alert buttons
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
2022-02-23 11:17:50 +01:00
Sam Hewitt
65b109763b Cleanup private use symbolics
- remove references to deprecated app symbolics
- reduce file size of private-use icons
- update dated icons
2022-02-04 18:12:41 +00:00
Felipe Borges
9c593c5d7b sound: Remove CcSoundButton in favor of a simple GtkToggleButton
Without the custom image allocation, we can simply use a simple
button instead.

Fixes #1583
2022-02-04 18:03:38 +00:00
Jakub Steiner
d85111f3f1 sound: remove noisy icon
- remove the oversized repeating icon, use only labels

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1583
2022-02-04 18:03:38 +00:00
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00: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
1ef843583d sound: Add boxed list around system volume
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
acd59aec65 Rename app-id to org.gnome.Settings
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
2022-01-21 13:08:50 +00:00
Georges Basile Stavracas Neto
0ab20af9ba panels: Switch to CcPanel content
Start porting panels to the new panel format. This commit
temporarily makes panels have two titlebar, which will be
fixed soon.
2022-01-20 02:23:42 +00:00
Jan Beich
37b29c32cb meson: drop unused argument for i18n.merge_file()
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.
[...]
2022-01-07 17:22:43 +00:00
Christopher Davis
e216f7f2db cc-sound-panel: Use AdwPreferencesPage and PreferencesGroup
libadwaita provides nice pre-built widgets for preferences
pages and groups. We should use them where possible.
2022-01-06 00:38:31 +00:00
Christopher Davis
981a8cea7b panels: Use .boxed-list instead of .content
The `.content` style class is deprecated in favor
of the `.boxed-list` style class, which is named
after the design pattern it's used for.
2021-12-16 12:52:44 -08:00
Georges Basile Stavracas Neto
a719008403 sound: Port to GTK4 2021-12-14 22:34:21 -03:00
Hui Wang
0f18a662be sound: update the volume-slider after getting a valid stream
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>
2021-08-01 22:12:11 +00:00
Mohammed Sadiq
7c575b8ccf sound: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Benjamin Berg
a87dee7911 sound: Update mute button icon when volume changes
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
2021-02-21 15:30:40 +00:00
Benjamin Berg
4b8ff9f6f3 sound: Include zero volume in lowest volume icon
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.
2021-02-21 15:30:39 +00:00
Arne
9225cd9364 sound: fix subwoofer slider 2020-09-25 01:53:44 +00:00
Hui Wang
9b81e0ee45 sound: update the profile list after getting the signal from gvc
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>
2020-09-16 09:10:02 +12:00
Adrien Plazas
f06379e30c Replace HdyColumn by HdyClamp
In libhandy 1, HdyClamp replaces HdyColumn. This stops setting values
when they match HdyClamp's defaults.
2020-07-20 08:04:28 +02:00
Robert Ancell
d9ea45354e sound: Stop non-interactive profile changes from triggering changed events
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1033
2020-06-17 19:29:57 +00:00