From 6af1fcb2671f44ce9a92283a08f09b362d27e09d Mon Sep 17 00:00:00 2001 From: Nick Dedekind Date: Fri, 25 Jul 2014 18:19:53 +0100 Subject: Added label to sliders --- src/sound-menu.vala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/sound-menu.vala b/src/sound-menu.vala index e37c4e9..8f14736 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -35,7 +35,7 @@ public class SoundMenu: Object this.volume_section = new Menu (); if ((flags & DisplayFlags.SHOW_MUTE) != 0) volume_section.append (_("Mute"), "indicator.mute"); - volume_section.append_item (this.create_slider_menu_item ("indicator.volume(0)", 0.0, 1.0, 0.01, + volume_section.append_item (this.create_slider_menu_item ("Volume", "indicator.volume(0)", 0.0, 1.0, 0.01, "audio-volume-low-zero-panel", "audio-volume-high-panel")); @@ -75,7 +75,7 @@ public class SoundMenu: Object } set { if (value && !this.mic_volume_shown) { - var slider = this.create_slider_menu_item ("indicator.mic-volume", 0.0, 1.0, 0.01, + var slider = this.create_slider_menu_item ("Microphone Volume", "indicator.mic-volume", 0.0, 1.0, 0.01, "audio-input-microphone-low-zero-panel", "audio-input-microphone-high-panel"); volume_section.append_item (slider); @@ -227,11 +227,11 @@ public class SoundMenu: Object player_section.append_submenu (_("Choose Playlist"), submenu); } - MenuItem create_slider_menu_item (string action, double min, double max, double step, string min_icon_name, string max_icon_name) { + MenuItem create_slider_menu_item (string label, string action, double min, double max, double step, string min_icon_name, string max_icon_name) { var min_icon = new ThemedIcon.with_default_fallbacks (min_icon_name); var max_icon = new ThemedIcon.with_default_fallbacks (max_icon_name); - var slider = new MenuItem (null, action); + var slider = new MenuItem (label, action); slider.set_attribute ("x-canonical-type", "s", "com.canonical.unity.slider"); slider.set_attribute_value ("min-icon", min_icon.serialize ()); slider.set_attribute_value ("max-icon", max_icon.serialize ()); -- cgit v1.2.3 From 7206e28a11ca16763edde8739fd85ee99939250e Mon Sep 17 00:00:00 2001 From: Nick Dedekind Date: Fri, 26 Sep 2014 14:52:56 +0100 Subject: use translatable string --- src/sound-menu.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sound-menu.vala b/src/sound-menu.vala index 8f14736..03faa89 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -35,7 +35,7 @@ public class SoundMenu: Object this.volume_section = new Menu (); if ((flags & DisplayFlags.SHOW_MUTE) != 0) volume_section.append (_("Mute"), "indicator.mute"); - volume_section.append_item (this.create_slider_menu_item ("Volume", "indicator.volume(0)", 0.0, 1.0, 0.01, + volume_section.append_item (this.create_slider_menu_item (_("Volume"), "indicator.volume(0)", 0.0, 1.0, 0.01, "audio-volume-low-zero-panel", "audio-volume-high-panel")); @@ -75,7 +75,7 @@ public class SoundMenu: Object } set { if (value && !this.mic_volume_shown) { - var slider = this.create_slider_menu_item ("Microphone Volume", "indicator.mic-volume", 0.0, 1.0, 0.01, + var slider = this.create_slider_menu_item (_("Microphone Volume"), "indicator.mic-volume", 0.0, 1.0, 0.01, "audio-input-microphone-low-zero-panel", "audio-input-microphone-high-panel"); volume_section.append_item (slider); -- cgit v1.2.3 From c53c5cc119f713fd0868a5643681df7b6e296fff Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Wed, 1 Oct 2014 16:51:09 +0200 Subject: Volume control: properly scale channels when setting the volume And display the volume of the loudest channel in the UI. This is consistent with gnome-control-center. --- src/volume-control.vala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/volume-control.vala b/src/volume-control.vala index 2efa186..a4015b5 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -129,9 +129,9 @@ public class VolumeControl : Object this.notify_property ("is-playing"); } - if (_volume != volume_to_double (i.volume.values[0])) + if (_volume != volume_to_double (i.volume.max ())) { - _volume = volume_to_double (i.volume.values[0]); + _volume = volume_to_double (i.volume.max ()); volume_changed (_volume); } } @@ -310,7 +310,8 @@ public class VolumeControl : Object if (i == null) return; - unowned CVolume cvol = vol_set (i.volume, 1, double_to_volume (_volume)); + unowned CVolume cvol = i.volume; + cvol.scale (double_to_volume (_volume)); c.set_sink_volume_by_index (i.index, cvol, set_volume_success_cb); } -- cgit v1.2.3