aboutsummaryrefslogtreecommitdiff
path: root/src/volume-control-pulse.vala
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-04-13 06:02:29 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-04-13 06:02:29 +0000
commit1229a5e66709c54dedca65507556453a97d6542b (patch)
tree10f300be7a7aa1bbda18b78b187dbe85fa3fb56a /src/volume-control-pulse.vala
parent7c512ad5d3e6cadbf07259f918f48bcaaea4f490 (diff)
parenta7296e5985d1b5e91bb97680547da071768a801f (diff)
downloadayatana-indicator-sound-1229a5e66709c54dedca65507556453a97d6542b.tar.gz
ayatana-indicator-sound-1229a5e66709c54dedca65507556453a97d6542b.tar.bz2
ayatana-indicator-sound-1229a5e66709c54dedca65507556453a97d6542b.zip
Fix stream property lookup to reliably signal multimedia streams Fixes: #1436021
Approved by: Ricardo Salveti, PS Jenkins bot
Diffstat (limited to 'src/volume-control-pulse.vala')
-rw-r--r--src/volume-control-pulse.vala14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala
index f162685..050318b 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;