diff options
author | Ted Gould <ted@gould.cx> | 2015-04-10 15:43:46 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2015-04-10 15:43:46 -0500 |
commit | 6325d23dd19d2e29977a17a0d143ece4baae5808 (patch) | |
tree | 55f055e2c8b1f17135c3fb8871999fa29d28505e | |
parent | ebd19de1c09b54e060ae1b327651558a7a694d53 (diff) | |
download | ayatana-indicator-sound-6325d23dd19d2e29977a17a0d143ece4baae5808.tar.gz ayatana-indicator-sound-6325d23dd19d2e29977a17a0d143ece4baae5808.tar.bz2 ayatana-indicator-sound-6325d23dd19d2e29977a17a0d143ece4baae5808.zip |
Change the stream definition to not use the index into the names table, the two indexes don't align.
-rw-r--r-- | src/volume-control-pulse.vala | 14 |
1 files 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; |