Commit graph

265 commits

Author SHA1 Message Date
velsinki
eacef5a5a2 sound: Prevent duplicate sound device entries
For unknown reasons, GVC mixer control can sometimes signal a new
device with the same id as one that was added before. This means that
in `device_added_cb`, a duplicate entry with that id is created, in my
case with a different name. However, the last one added is valid, but
that one cannot be selected because all other logic in the sound panel
assumes the first hit in `get_iter` is valid. This breaks sound input
selection then.

The fix is easy; only add a new list entry if none with that id exists.
2023-03-22 13:06:39 +00:00
Jakub Steiner
a3c16f103b sound: Make bass audible on low quality hardware
- add mid range frequencies to make the bassy sound more audible on sub par hardware,
  because that's 85% of the hardware gnome runs on, sadly.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2268
2023-03-16 11:53:29 +00:00
Lukáš Tyrychtr
62708fc44f Add the label with the current alert sound as a description for the row, so a screen reader reads it 2023-02-17 02:08:47 +00:00
Marco Melorio
9f7fad1aca sound: Add .lowres-icon to CcStreamRow app icons 2023-01-30 10:50:11 +00:00
Marco Melorio
be89d7df88 sound: Format sound-panel.ui 2023-01-30 10:49:09 +00:00
Marco Melorio
29514add66 sound: Remove the nested GtkListBox
See the previous commit for more info.

The UI file is not formatted on purpose to facilitate the review. It
will be reformatted in the next commit.
2023-01-30 10:49:09 +00:00
Marco Melorio
ec9a0052ba sound: Move the "No Devices" rows in different groups
Previously this was problematic because the current layout is a bit
messy. The reasoning is a bit complex, but I'll try to explain below.

Basically the AdwPreferencesGroup has an integrated GtkListBox where the
rows should normally be added to it by declaring AdwPreferencesRow
subclasses as its direct children in the UI file. This is not currently
done in the sound panel and we instead have another GtkListBox as its
direct child, while the "No Devices" row is actually a AdwPreferencesRow
subclass, so we end up with two listboxes with .boxed-list style. The
problem is that we hide the "No Devices" row when there are devices
available, but the internal listbox is still there, so we still see its
shadows.

This commit just separates the "No Devices" row in a separate group so
that we are sure to hide everything correctly.
2023-01-30 10:49:09 +00:00
Marco Melorio
fc3580f2f2 sound: Fix warning about missing measure in output test
Just measure the label to make GTK not complain about allocating
children without measuring anything. Measuring all the buttons is an
overkill because we expect this widget to have the minimum size
overwritten by CSS either way.
2023-01-27 17:46:58 +00:00
Marco Melorio
8dbf562276 sound: Remove stray character in UI file 2023-01-16 20:53:57 +01:00
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
866b08b4e8 sound: Hide controls when there are no devices
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1221
and https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1575.
2023-01-16 20:53:15 +01:00
Marco Melorio
ba2a71fb44 sound: Cleanup and reorganize variables in CcSoundPanel
Remove unused ones and keep the same order as the UI hierarchy.
2023-01-16 20:52:14 +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
b3d99f281a sound: Add a "None" option to the alert chooser
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2251.
2023-01-16 19:43:53 +00:00
Marco Melorio
98c8a7787c sound: Move alert chooser to a separate window 2023-01-16 19:43:53 +00:00
Marco Melorio
2fbbe0f60d sound: Use a microphone icon for input in CcVolumeSlider
There was some code that attempted to do that, but was incorrect.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1762.
2023-01-15 20:07:04 +01:00
Marco Melorio
ca553bd377 sound: Make mute button in CcVolumeSlider more consistent
When pressing the mute button after the volume slider is manually moved
to 0 (and so the GVS "is-muted" property is still FALSE), set the volume
to 25% instead of actually muting the stream.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/520.
2023-01-15 19:56:10 +01:00
Marco Melorio
7fddfa363f sound: Port the mute button in the CcVolumeSlider to GtkButton
The logic inside it is a bit reworked to make it more consistent. The
mute button and the slider now only communicate directly with GVC. The
notify callbacks are now used to change the UI states.

This fixes the UI problem of the mute button being "raised" when pressed
(see https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/520).
2023-01-15 19:44:23 +01:00
Marco Melorio
7556aef2aa sound: Add level bars to the stream rows
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1303.
2023-01-12 13:25:27 +00:00
Marco Melorio
1950d1d7b5 sound: Move the mute buttons to the left side of the sliders 2023-01-12 13:25:27 +00:00
Marco Melorio
24ff4bd402 sound: Rename input volume label to match mockup
Rename "Volume" to "Input Volume", to match the mockup and the output
volume label.
2023-01-12 13:25:27 +00:00
Marco Melorio
fd3e7e478a sound: Move output volume slider in the "Output" section 2023-01-12 13:25:27 +00:00
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