diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2014-02-20 18:32:14 +0100 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2014-02-20 18:32:14 +0100 |
commit | bbecb29d344887879e900319eb96cf19d44bde27 (patch) | |
tree | b1017c5f79a98a4b74f497dcfb6de50e4a699b09 /src | |
parent | 474b7ff95f176c0d1a12df3107c1b21b129b138d (diff) | |
download | ayatana-indicator-sound-bbecb29d344887879e900319eb96cf19d44bde27.tar.gz ayatana-indicator-sound-bbecb29d344887879e900319eb96cf19d44bde27.tar.bz2 ayatana-indicator-sound-bbecb29d344887879e900319eb96cf19d44bde27.zip |
Add comments explaining max_volume a bit better
Diffstat (limited to 'src')
-rw-r--r-- | src/service.vala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/service.vala b/src/service.vala index 87e8b8b..b1b5ba9 100644 --- a/src/service.vala +++ b/src/service.vala @@ -87,6 +87,7 @@ public class IndicatorSound.Service: Object { this.max_volume = 1.0; } + /* Normalize volume, because the volume action's state is [0.0, 1.0], see create_volume_action() */ this.actions.change_action_state ("volume", this.volume_control.get_volume () / this.max_volume); } } @@ -107,6 +108,10 @@ public class IndicatorSound.Service: Object { uint player_action_update_id; Notify.Notification notification; bool syncing_preferred_players = false; + + /* Maximum volume as a scaling factor between the volume action's state and the value in + * this.volume_control. See create_volume_action(). + */ double max_volume = 1.0; const double volume_step_percentage = 0.06; @@ -222,6 +227,8 @@ public class IndicatorSound.Service: Object { void volume_changed (double volume) { var volume_action = this.actions.lookup_action ("volume") as SimpleAction; + + /* Normalize volume, because the volume action's state is [0.0, 1.0], see create_volume_action() */ volume_action.set_state (new Variant.double (volume / this.max_volume)); this.update_root_icon (); |