From e49548a7edb0d4d8a3420cc6c0be2b0e15f57bcf Mon Sep 17 00:00:00 2001 From: Xavi Garcia Mena Date: Fri, 2 Oct 2015 12:46:54 +0200 Subject: Updated to show a label stating the active output --- src/service.vala | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/service.vala b/src/service.vala index a1850d0..15fd97e 100644 --- a/src/service.vala +++ b/src/service.vala @@ -411,9 +411,23 @@ public class IndicatorSound.Service: Object { if (notify_server_supports_sync && !block_info_notifications) { /* Determine Label */ - unowned string volume_label = loud + string volume_label = loud ? _("High volume can damage your hearing.") : ""; + + if (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"); + } + } /* Choose an icon */ string icon = get_volume_notification_icon (volume_control.volume.volume, loud, volume_control.active_output); -- cgit v1.2.3