aboutsummaryrefslogtreecommitdiff
path: root/src/service.vala
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-05 12:10:49 +0200
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-05 12:10:49 +0200
commit24ab28edf43e3ec188d110d08c810567539d8eb4 (patch)
tree04f8fa51e3ba9b6a69484f5bbe17b9eef155b309 /src/service.vala
parente49548a7edb0d4d8a3420cc6c0be2b0e15f57bcf (diff)
downloadayatana-indicator-sound-24ab28edf43e3ec188d110d08c810567539d8eb4.tar.gz
ayatana-indicator-sound-24ab28edf43e3ec188d110d08c810567539d8eb4.tar.bz2
ayatana-indicator-sound-24ab28edf43e3ec188d110d08c810567539d8eb4.zip
Added USB and HDMI active outputs
Diffstat (limited to 'src/service.vala')
-rw-r--r--src/service.vala133
1 files changed, 129 insertions, 4 deletions
diff --git a/src/service.vala b/src/service.vala
index 15fd97e..e3e91f5 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -313,6 +313,56 @@ public class IndicatorSound.Service: Object {
else
icon = "audio-volume-high";
break;
+ case VolumeControl.ActiveOutput.BLUETOOTH_SPEAKER:
+ if (volume <= 0.0)
+ icon = "audio-volume-muted";
+ else if (volume <= 0.3)
+ icon = "audio-volume-low";
+ else if (volume <= 0.7)
+ icon = "audio-volume-medium";
+ else
+ icon = "audio-volume-high";
+ break;
+ case VolumeControl.ActiveOutput.USB_SPEAKER:
+ if (volume <= 0.0)
+ icon = "audio-volume-muted";
+ else if (volume <= 0.3)
+ icon = "audio-volume-low";
+ else if (volume <= 0.7)
+ icon = "audio-volume-medium";
+ else
+ icon = "audio-volume-high";
+ break;
+ case VolumeControl.ActiveOutput.USB_HEADPHONES:
+ if (volume <= 0.0)
+ icon = "audio-volume-muted";
+ else if (volume <= 0.3)
+ icon = "audio-volume-low";
+ else if (volume <= 0.7)
+ icon = "audio-volume-medium";
+ else
+ icon = "audio-volume-high";
+ break;
+ case VolumeControl.ActiveOutput.HDMI_SPEAKER:
+ if (volume <= 0.0)
+ icon = "audio-volume-muted";
+ else if (volume <= 0.3)
+ icon = "audio-volume-low";
+ else if (volume <= 0.7)
+ icon = "audio-volume-medium";
+ else
+ icon = "audio-volume-high";
+ break;
+ case VolumeControl.ActiveOutput.HDMI_HEADPHONES:
+ if (volume <= 0.0)
+ icon = "audio-volume-muted";
+ else if (volume <= 0.3)
+ icon = "audio-volume-low";
+ else if (volume <= 0.7)
+ icon = "audio-volume-medium";
+ else
+ icon = "audio-volume-high";
+ break;
}
return icon;
}
@@ -331,6 +381,21 @@ public class IndicatorSound.Service: Object {
case VolumeControl.ActiveOutput.BLUETOOTH_HEADPHONES:
icon = "audio-volume-high";
break;
+ case VolumeControl.ActiveOutput.BLUETOOTH_SPEAKER:
+ icon = "audio-volume-high";
+ break;
+ case VolumeControl.ActiveOutput.USB_SPEAKER:
+ icon = "audio-volume-high";
+ break;
+ case VolumeControl.ActiveOutput.USB_HEADPHONES:
+ icon = "audio-volume-high";
+ break;
+ case VolumeControl.ActiveOutput.HDMI_SPEAKER:
+ icon = "audio-volume-high";
+ break;
+ case VolumeControl.ActiveOutput.HDMI_HEADPHONES:
+ icon = "audio-volume-high";
+ break;
}
} else {
icon = get_volume_icon (volume, active_output);
@@ -366,6 +431,46 @@ public class IndicatorSound.Service: Object {
else
icon = get_volume_icon (volume, active_output);
break;
+ case VolumeControl.ActiveOutput.BLUETOOTH_SPEAKER:
+ if (mute || volume <= 0.0)
+ icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel";
+ else if (this.accounts_service != null && this.accounts_service.silentMode)
+ icon = "audio-volume-muted-panel";
+ else
+ icon = get_volume_icon (volume, active_output);
+ break;
+ case VolumeControl.ActiveOutput.USB_SPEAKER:
+ if (mute || volume <= 0.0)
+ icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel";
+ else if (this.accounts_service != null && this.accounts_service.silentMode)
+ icon = "audio-volume-muted-panel";
+ else
+ icon = get_volume_icon (volume, active_output);
+ break;
+ case VolumeControl.ActiveOutput.USB_HEADPHONES:
+ if (mute || volume <= 0.0)
+ icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel";
+ else if (this.accounts_service != null && this.accounts_service.silentMode)
+ icon = "audio-volume-muted-panel";
+ else
+ icon = get_volume_icon (volume, active_output);
+ break;
+ case VolumeControl.ActiveOutput.HDMI_SPEAKER:
+ if (mute || volume <= 0.0)
+ icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel";
+ else if (this.accounts_service != null && this.accounts_service.silentMode)
+ icon = "audio-volume-muted-panel";
+ else
+ icon = get_volume_icon (volume, active_output);
+ break;
+ case VolumeControl.ActiveOutput.HDMI_HEADPHONES:
+ if (mute || volume <= 0.0)
+ icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel";
+ else if (this.accounts_service != null && this.accounts_service.silentMode)
+ icon = "audio-volume-muted-panel";
+ else
+ icon = get_volume_icon (volume, active_output);
+ break;
}
return icon;
}
@@ -421,12 +526,32 @@ public class IndicatorSound.Service: Object {
}
if (volume_control.active_output == VolumeControl.ActiveOutput.HEADPHONES) {
- volume_label = _("Headphones");
- }
+ volume_label = _("Headphones");
+ }
if (volume_control.active_output == VolumeControl.ActiveOutput.BLUETOOTH_HEADPHONES) {
- volume_label = _("Bluetooth");
- }
+ 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");
+ }
}
/* Choose an icon */