Commit graph

214 commits

Author SHA1 Message Date
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
Robert Ancell
7a65d113f2 sound: Remove unused files
These were accidentally added as part of ths sound panel redesign.
2020-03-19 16:22:20 +13:00
Mohammed Sadiq
dfd4d42fd0 sound: Prefer symbolic icons for audio streams 2020-02-13 21:12:37 +00:00
Robert Ancell
cc4478d4f8 sound: Add missing subwoofer icons
These were accidentally dropped in the migration from the old panel to the new one.

Fixes #825
2020-01-07 20:49:12 +00:00
Georges Basile Stavracas Neto
5f640b9903 panel-list: Reorganize Devices section
Move the Power and Sound panel to there.
2020-01-06 15:15:30 +00:00
Felipe Borges
4180e75aad sound: Set audio icon based on volume
The same way that GNOME Shell does it, we set:
 * audio-volume-muted-symbolic when mute button is toggled*
 * audio-volume-low-symbolic when 0 < volume < 30%
 * audio-volume-medium-symbolic when 30% < volume < 70%
 * audio-volume-high-symbolic when 70% < volume <= 100%

When "muted" we can't actually rely on volume (it can be close
to zero but not absolute zero). Instead of requiring volume == 0,
we track the state based on whether the mute button is active.

Fixes #521
2019-12-18 12:00:02 +01:00
Robert Ancell
667fe61e78 sound: Replace ifdefs with #pragma once 2019-11-27 21:56:10 +00:00
Robert Ancell
ea22446ad1 sound: Remove reference to unused widget 2019-11-12 14:31:14 +13:00
Mart Raudsepp
389e7f59ae sound: Remove leftover canberra-gtk header inclusion
This may fail to build too, as we don't depend on canberra-gtk anymore,
and gsound only depends on canberra, not canberra-gtk.
2019-09-20 08:50:26 +03:00
Felipe Borges
be9d71ed6a sound: Use "avatar-default-symbolic" in sound test dialog
The colour icon blends with bright themes (such as Adwaita) making
it hard to distinguish.

The symbolic variant of the same asset contrasts fine with light
and dark background and matches the "symbolic" pattern of the other
two buttons shown in the dialog (the audio-volume-* icons).

Fixes #502
2019-09-17 10:33:38 +02:00
Iain Lane
ad39840066 sound: Pass a GvcMixerControl to the stream volume sliders
Since 9d612ff1c7 this is required,
otherwise we never set up the GtkAdjustment and so the scales don't
display any values or widget to make adjustments, meaning they can't be
used.

Also call `notify_volume_cb()` from `update_ranges()` to initialise the
adjustment, since when we set the mixer control we now might not have
set the value.

Closes #652
2019-09-09 15:23:32 +00:00
Robert Ancell
9d612ff1c7 sound: Fix volume sliders regression
GVC added additional checks that break where we were using a NULL value instead
of a GvcMixerControl. Solution is to pass this object where appropriate.

(gnome-control-center:833): Gvc-CRITICAL **: 11:09:33.818: gvc_mixer_control_get_vol_max_norm: assertion 'GVC_IS_MIXER_CONTROL (control)' failed

Fixes #636
2019-08-25 09:51:31 +00: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
Georges Basile Stavracas Neto
a9f0248376 sound: Use fallback icon when stream's icon doesn't exist
Some streams may give us an icon name that doesn't exist in the
icon theme (e.g. Spotify giving "audio"). While it's fundamentally
an application problem, we can deal with this case a bit better
than showing the ugly "image-missing" icon.

Detect when an icon doesn't exist by performing an icon theme
lookup and, if the icon really doesn't exist, use a proper fallback
icon.

It also avoids a small GIcon leak.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/548
2019-06-16 01:01:36 +00:00
Georges Basile Stavracas Neto
e8bd7c24ee sound: Remove icon from sound theme buttons
Remove the icon and adjust the label to be vertically
centralized.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/549
2019-06-16 01:01:36 +00:00
Benjamin Berg
6872c767bb sound: Clean up labels of devices without origin
Sound devices may not have an origin, in that case we ended up with a
trailing " - " in the label which should not be there. Add a check that
the origin is non-null and not an empty string and only show the devices
description otherwise.
2019-05-22 17:19:26 +02:00
Bastien Nocera
d36cffa290 sound: Add "input" and "output" keywords to the panel 2019-05-14 01:55:59 +00:00
Robert Ancell
82ca937ecd sound: Fix crash when sound device set to NULL
This can occur during transitions.

Introduced in f081264.
2019-03-14 11:28:08 +13:00
Robert Ancell
f0812644ae sound: Apply device changes
Was missing the code to actually apply the changes.
2019-03-14 10:58:59 +13:00
Felipe Borges
de769bbe9b sound: Add shadow to application icons
The new GNOME application icons need a shadow when placed on top
of a light background.

See https://gitlab.gnome.org/GNOME/Initiatives/issues/2
2019-03-13 13:46:53 +01:00
Adrien Plazas
c74d28009c sound: Make the panel adaptive
Use a HdyColumn and ellipsize same labels so the panel can fit in
narrower windows.
2019-02-18 15:12:53 +01:00
Robert Ancell
0799c864e8 sound: Rename new sound panel to replace old one 2019-02-07 09:31:18 +13:00
Robert Ancell
652dd8bfc8 sound: Remove old panel
This has been replaced with a new implementation that uses the new designs.
2019-02-07 09:31:18 +13:00
Robert Ancell
74b54f6336 sound: Don't use gtk_widget_show_all
It is removed in GTK+ 4
2018-10-18 01:18:57 +00:00
Piotr Drąg
7265bd53a0 Add translator comments to .desktop files
Icons are confusing translators, and gettext
is unlikely to get fixed any time soon.
2018-02-23 18:49:35 +01:00
Robert Ancell
911e7d4e4f sound: Use g_auto for variables
https://bugzilla.gnome.org/show_bug.cgi?id=788223
2018-01-25 23:28:41 -02:00
Iñigo Martínez
0dd386f405 build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats
that are used in GNOME applications. This patch migrates from
Intltool to Gettext by using meson's i18n features.

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-23 10:49:31 +01:00
Piotr Drąg
9db20522d3 sound: specify encoding in the XML declaration of gnome-sounds-default.xml
Without it, gettext mangles UTF-8 characters.

See https://savannah.gnu.org/bugs/?52932

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-19 16:41:30 +01:00
Iñigo Martínez
dc0988d47c build: Remove autotools
To avoid the burden of maintaining multiple build systems, this
patch removes autotools support.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-18 12:20:08 +01:00