aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-10-10 16:10:15 -0500
committerTed Gould <ted@gould.cx>2014-10-10 16:10:15 -0500
commit53edccc48b6b1999457aaa4241bfc8eee413f16c (patch)
treeede537d876dcb93d6cfb75ac4be5b37f8ffdc4f1
parentb6081ca691dc5d7cc41b41837378f8045a8741e8 (diff)
downloadayatana-indicator-sound-53edccc48b6b1999457aaa4241bfc8eee413f16c.tar.gz
ayatana-indicator-sound-53edccc48b6b1999457aaa4241bfc8eee413f16c.tar.bz2
ayatana-indicator-sound-53edccc48b6b1999457aaa4241bfc8eee413f16c.zip
Turn high volume into a property
-rw-r--r--src/volume-control.vala12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/volume-control.vala b/src/volume-control.vala
index 0e5abbb..e09f212 100644
--- a/src/volume-control.vala
+++ b/src/volume-control.vala
@@ -79,6 +79,9 @@ public class VolumeControl : Object
/** true when a microphone is active **/
public bool active_mic { get; private set; default = false; }
+ /** true when high volume warnings should be shown */
+ public bool high_volume { get; set; }
+
public VolumeControl ()
{
if (loop == null)
@@ -581,13 +584,14 @@ public class VolumeControl : Object
/* Using this to detect whether we're on the phone or not */
if (_pulse_use_stream_restore) {
/* Watch for extreme */
- bool extreme_volume = false;
if (volume > 0.75) /* TODO: Also if headphones */
- extreme_volume = true;
+ high_volume = true;
+ else
+ high_volume = false;
/* Determine Label */
string volume_label = _("Volume");
- if (extreme_volume)
+ if (high_volume)
volume_label = _("High volume");
/* Choose an icon */
@@ -606,7 +610,7 @@ public class VolumeControl : Object
/* Check tint */
string tint = "false";
- if (extreme_volume)
+ if (high_volume)
tint = "true";
/* Put it all into the notification */