From 6325d23dd19d2e29977a17a0d143ece4baae5808 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 10 Apr 2015 15:43:46 -0500 Subject: Change the stream definition to not use the index into the names table, the two indexes don't align. --- src/volume-control-pulse.vala | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala index 76368f2..9ac7dce 100644 --- a/src/volume-control-pulse.vala +++ b/src/volume-control-pulse.vala @@ -56,10 +56,18 @@ public class VolumeControlPulse : VolumeControl private string[] _valid_roles = {"multimedia", "alert", "alarm", "phone"}; public override string stream { get { - if (_active_sink_input < 0 || _active_sink_input >= _valid_roles.length) + if (_active_sink_input == -1) return "alert"; - else - return _valid_roles[_active_sink_input]; + var path = _sink_input_hash[_active_sink_input]; + if (path == _objp_role_multimedia) + return "multimedia"; + if (path == _objp_role_alert) + return "alert"; + if (path == _objp_role_alarm) + return "alarm"; + if (path == _objp_role_phone) + return "phone"; + return "alert"; } } private string? _objp_role_multimedia = null; -- cgit v1.2.3