aboutsummaryrefslogtreecommitdiff
path: root/src/sound-menu.vala
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-01 09:55:22 +0200
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-01 09:55:22 +0200
commit33a73fad65c52fc324ad3d35a6d1305a1489958d (patch)
treed1c9058705592e5ff7b56c9e9aae6ea57b502ff7 /src/sound-menu.vala
parenta7fd579fd1bc6eb02433ccd72e9f54dca2615675 (diff)
downloadayatana-indicator-sound-33a73fad65c52fc324ad3d35a6d1305a1489958d.tar.gz
ayatana-indicator-sound-33a73fad65c52fc324ad3d35a6d1305a1489958d.tar.bz2
ayatana-indicator-sound-33a73fad65c52fc324ad3d35a6d1305a1489958d.zip
Changed to show a notification when the active output changes
Diffstat (limited to 'src/sound-menu.vala')
-rw-r--r--src/sound-menu.vala15
1 files changed, 13 insertions, 2 deletions
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",