diff options
author | charles kerr <charlesk@canonical.com> | 2015-12-28 14:00:30 -0600 |
---|---|---|
committer | charles kerr <charlesk@canonical.com> | 2015-12-28 14:00:30 -0600 |
commit | 77da5e401a251fd305705538d5f34c955944061e (patch) | |
tree | 6f4e0d38f985d363e2eb15282af50e295998280e /src/volume-warning.vala | |
parent | 39781ce9582031d0e48a71b03079ba0625c1710f (diff) | |
download | ayatana-indicator-sound-77da5e401a251fd305705538d5f34c955944061e.tar.gz ayatana-indicator-sound-77da5e401a251fd305705538d5f34c955944061e.tar.bz2 ayatana-indicator-sound-77da5e401a251fd305705538d5f34c955944061e.zip |
update volume-warning's 'multimedia-volume' property from pulse
Diffstat (limited to 'src/volume-warning.vala')
-rw-r--r-- | src/volume-warning.vala | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/volume-warning.vala b/src/volume-warning.vala index eb6b3d5..f7e3d15 100644 --- a/src/volume-warning.vala +++ b/src/volume-warning.vala @@ -154,6 +154,9 @@ public class VolumeWarning : Object private void pulse_on_sink_input_info (Context c, SinkInputInfo? i, int eol) { + if (eol != 0) + GLib.message("at end of list, _multimedia_sink_input_index is %d", (int)_multimedia_sink_input_index); + if (i == null) return; @@ -173,8 +176,13 @@ public class VolumeWarning : Object GLib.message("driver %s", i.driver); } - if (eol != 0) - GLib.message("at end of list, _multimedia_sink_input_index is %d", (int)_multimedia_sink_input_index); + if (i.index == _multimedia_sink_input_index) { + var vol = i.volume.max(); + if (multimedia_volume != vol) { + GLib.message("setting multimedia_volume to %d from pulse_on_sink_input_info()", (int)vol); + multimedia_volume = vol; + } + } } private void pulse_update_sink_inputs_cancel() |