aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/service.vala50
1 files changed, 27 insertions, 23 deletions
diff --git a/src/service.vala b/src/service.vala
index b238201..74c00fc 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -567,30 +567,34 @@ public class IndicatorSound.Service: Object {
private string get_notification_label () {
string volume_label = "";
- if (volume_control.active_output == VolumeControl.ActiveOutput.SPEAKERS) {
- volume_label = _("Speakers");
- }
- if (volume_control.active_output == VolumeControl.ActiveOutput.HEADPHONES) {
- volume_label = _("Headphones");
- }
- if (volume_control.active_output == VolumeControl.ActiveOutput.BLUETOOTH_HEADPHONES) {
- volume_label = _("Bluetooth headphones");
- }
- if (volume_control.active_output == VolumeControl.ActiveOutput.BLUETOOTH_SPEAKER) {
- volume_label = _("Bluetooth speaker");
- }
- if (volume_control.active_output == VolumeControl.ActiveOutput.USB_SPEAKER) {
- volume_label = _("Usb speaker");
- }
- if (volume_control.active_output == VolumeControl.ActiveOutput.USB_HEADPHONES) {
- volume_label = _("Usb headphones");
- }
- if (volume_control.active_output == VolumeControl.ActiveOutput.HDMI_SPEAKER) {
- volume_label = _("HDMI speaker");
- }
- if (volume_control.active_output == VolumeControl.ActiveOutput.HDMI_HEADPHONES) {
- volume_label = _("HDMI headphones");
+ switch (volume_control.active_output)
+ {
+ case VolumeControl.ActiveOutput.SPEAKERS:
+ volume_label = _("Speakers");
+ break;
+ case VolumeControl.ActiveOutput.HEADPHONES:
+ volume_label = _("Headphones");
+ break;
+ case VolumeControl.ActiveOutput.BLUETOOTH_HEADPHONES:
+ volume_label = _("Bluetooth headphones");
+ break;
+ case VolumeControl.ActiveOutput.BLUETOOTH_SPEAKER:
+ volume_label = _("Bluetooth speaker");
+ break;
+ case VolumeControl.ActiveOutput.USB_SPEAKER:
+ volume_label = _("Usb speaker");
+ break;
+ case VolumeControl.ActiveOutput.USB_HEADPHONES:
+ volume_label = _("Usb headphones");
+ break;
+ case VolumeControl.ActiveOutput.HDMI_SPEAKER:
+ volume_label = _("HDMI speaker");
+ break;
+ case VolumeControl.ActiveOutput.HDMI_HEADPHONES:
+ volume_label = _("HDMI headphones");
+ break;
}
+
return volume_label;
}