diff options
author | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2016-03-17 10:06:24 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2016-03-17 10:06:24 +0000 |
commit | ce15e8ab1cc1fd37df3badad69da4e0ecc7b9318 (patch) | |
tree | 26e355f5d1c702dc8a2b9e67702ace213e9054ec /src | |
parent | e24fb23ad146190a7ba873abb620e2a6def0ad21 (diff) | |
parent | 2acd4961a7e5af93f863503eca90f51d28e6603d (diff) | |
download | ayatana-indicator-sound-ce15e8ab1cc1fd37df3badad69da4e0ecc7b9318.tar.gz ayatana-indicator-sound-ce15e8ab1cc1fd37df3badad69da4e0ecc7b9318.tar.bz2 ayatana-indicator-sound-ce15e8ab1cc1fd37df3badad69da4e0ecc7b9318.zip |
Changed to code to get the root icon. Now it does not take into account the source output, as in fact that code was not differentiating between any particular case.
The code was added in the past in the case that we should differentiate between bluetooth, headphones, etc... but it was never used. Fixes: #1555831
Approved by: Charles Kerr
Diffstat (limited to 'src')
-rw-r--r-- | src/service.vala | 50 |
1 files changed, 9 insertions, 41 deletions
diff --git a/src/service.vala b/src/service.vala index bdc4d40..651ec73 100644 --- a/src/service.vala +++ b/src/service.vala @@ -290,48 +290,16 @@ public class IndicatorSound.Service: Object { private bool block_info_notifications = false; - private static unowned string get_volume_root_icon_by_volume (double volume, VolumeControl.ActiveOutput active_output) { - switch (active_output) { - case VolumeControl.ActiveOutput.SPEAKERS: - case VolumeControl.ActiveOutput.HEADPHONES: - case VolumeControl.ActiveOutput.BLUETOOTH_HEADPHONES: - case VolumeControl.ActiveOutput.BLUETOOTH_SPEAKER: - case VolumeControl.ActiveOutput.USB_SPEAKER: - case VolumeControl.ActiveOutput.USB_HEADPHONES: - case VolumeControl.ActiveOutput.HDMI_SPEAKER: - case VolumeControl.ActiveOutput.HDMI_HEADPHONES: - if (volume <= 0.0) - return "audio-volume-muted-panel"; - if (volume <= 0.3) - return "audio-volume-low-panel"; - if (volume <= 0.7) - return "audio-volume-medium-panel"; - return "audio-volume-high-panel"; - - default: - return ""; - } - } - private unowned string get_volume_root_icon (double volume, bool mute, VolumeControl.ActiveOutput active_output) { - switch (active_output) { - case VolumeControl.ActiveOutput.SPEAKERS: - case VolumeControl.ActiveOutput.HEADPHONES: - case VolumeControl.ActiveOutput.BLUETOOTH_HEADPHONES: - case VolumeControl.ActiveOutput.BLUETOOTH_SPEAKER: - case VolumeControl.ActiveOutput.USB_SPEAKER: - case VolumeControl.ActiveOutput.USB_HEADPHONES: - case VolumeControl.ActiveOutput.HDMI_SPEAKER: - case VolumeControl.ActiveOutput.HDMI_HEADPHONES: - if (mute || volume <= 0.0) - return this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel"; - if (this.accounts_service != null && this.accounts_service.silentMode) - return "audio-volume-muted-panel"; - return get_volume_root_icon_by_volume (volume, active_output); - - default: - return ""; - } + if (mute || volume <= 0.0) + return this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel"; + if (this.accounts_service != null && this.accounts_service.silentMode) + return "audio-volume-muted-panel"; + if (volume <= 0.3) + return "audio-volume-low-panel"; + if (volume <= 0.7) + return "audio-volume-medium-panel"; + return "audio-volume-high-panel"; } private void update_notification () { |