aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2014-10-01 16:51:09 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2014-10-01 16:51:09 +0200
commitc53c5cc119f713fd0868a5643681df7b6e296fff (patch)
treeb13d464ee25538baae9053611ce6acc41048e0b7
parent5bac1dc620f1499b6b2bf9d4b0371a5f2e530696 (diff)
downloadayatana-indicator-sound-c53c5cc119f713fd0868a5643681df7b6e296fff.tar.gz
ayatana-indicator-sound-c53c5cc119f713fd0868a5643681df7b6e296fff.tar.bz2
ayatana-indicator-sound-c53c5cc119f713fd0868a5643681df7b6e296fff.zip
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.
-rw-r--r--src/volume-control.vala7
1 files changed, 4 insertions, 3 deletions
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);
}