From 33a73fad65c52fc324ad3d35a6d1305a1489958d Mon Sep 17 00:00:00 2001 From: Xavi Garcia Mena Date: Thu, 1 Oct 2015 09:55:22 +0200 Subject: Changed to show a notification when the active output changes --- src/sound-menu.vala | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/sound-menu.vala') diff --git a/src/sound-menu.vala b/src/sound-menu.vala index 8f63d69..b4e3e2a 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -186,10 +186,21 @@ public class SoundMenu: Object this.notify_handlers.remove (player); } - public void update_volume_slider (bool bluetooth_headset_active) { + public void update_volume_slider (VolumeControl.ActiveOutput active_output) { int index = find_action (this.volume_section, "indicator.volume"); if (index != -1) { - string label = bluetooth_headset_active ? "Volume (Bluetooth)" : "Volume"; + string label = "Volume"; + switch (active_output) { + case VolumeControl.ActiveOutput.SPEAKERS: + label = "Volume"; + break; + case VolumeControl.ActiveOutput.HEADPHONES: + label = "Volume (Headphones)"; + break; + case VolumeControl.ActiveOutput.BLUETOOTH_HEADPHONES: + label = "Volume (Bluetooth)"; + break; + } this.volume_section.remove (index); this.volume_section.insert_item (index, this.create_slider_menu_item (_(label), "indicator.volume(0)", 0.0, 1.0, 0.01, "audio-volume-low-zero-panel", -- cgit v1.2.3