diff options
-rw-r--r-- | src/service.vala | 38 | ||||
-rw-r--r-- | src/volume-control-pulse.vala | 12 | ||||
-rw-r--r-- | src/volume-control.vala | 14 |
3 files changed, 32 insertions, 32 deletions
diff --git a/src/service.vala b/src/service.vala index a8e11fd..8da44da 100644 --- a/src/service.vala +++ b/src/service.vala @@ -142,7 +142,7 @@ public class IndicatorSound.Service: Object { clear_acts_player(); - stop_clamp_to_high_timeout(); + stop_clamp_to_high_timeout(); if (this.player_action_update_id > 0) { Source.remove (this.player_action_update_id); @@ -242,7 +242,7 @@ public class IndicatorSound.Service: Object { if (this.volume_control.mute) icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel"; else if (this.accounts_service != null && this.accounts_service.silentMode) - icon = "audio-volume-muted-panel"; + icon = "audio-volume-muted-panel"; else if (volume <= 0.0) icon = "audio-volume-low-zero-panel"; else if (volume <= 0.3) @@ -622,26 +622,26 @@ public class IndicatorSound.Service: Object { this.update_preferred_players (); } - /** VOLUME CLAMPING **/ + /** VOLUME CLAMPING **/ - private uint _clamp_to_high_timeout = 0; + private uint _clamp_to_high_timeout = 0; - private void stop_clamp_to_high_timeout() { - if (_clamp_to_high_timeout != 0) { - Source.remove(_clamp_to_high_timeout); - _clamp_to_high_timeout = 0; - } - } + private void stop_clamp_to_high_timeout() { + if (_clamp_to_high_timeout != 0) { + Source.remove(_clamp_to_high_timeout); + _clamp_to_high_timeout = 0; + } + } - private void clamp_to_high_soon() { - const uint interval_msec = 200; /* arbitrary, but works */ - if (_clamp_to_high_timeout == 0) - _clamp_to_high_timeout = Timeout.add(interval_msec, clamp_to_high_idle); - } + private void clamp_to_high_soon() { + const uint interval_msec = 200; /* arbitrary, but works */ + if (_clamp_to_high_timeout == 0) + _clamp_to_high_timeout = Timeout.add(interval_msec, clamp_to_high_idle); + } - private bool clamp_to_high_idle() { - _clamp_to_high_timeout = 0; + private bool clamp_to_high_idle() { + _clamp_to_high_timeout = 0; volume_control.clamp_to_high_volume(); - return false; // Source.REMOVE; - } + return false; // Source.REMOVE; + } } diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala index bc0fa40..21e7a5c 100644 --- a/src/volume-control-pulse.vala +++ b/src/volume-control-pulse.vala @@ -28,8 +28,8 @@ extern unowned PulseAudio.CVolume? vol_set (PulseAudio.CVolume? cv, uint channel [DBus (name="com.canonical.UnityGreeter.List")] interface GreeterListInterface : Object { - public abstract async string get_active_entry () throws IOError; - public signal void entry_selected (string entry_name); + public abstract async string get_active_entry () throws IOError; + public signal void entry_selected (string entry_name); } public class VolumeControlPulse : VolumeControl @@ -212,7 +212,7 @@ public class VolumeControlPulse : VolumeControl vol.volume = volume_to_double (i.volume.max ()); vol.reason = VolumeControl.VolumeReasons.PULSE_CHANGE; this.volume = vol; - } + } } private void source_info_cb (Context c, SourceInfo? i, int eol) @@ -768,9 +768,9 @@ public class VolumeControlPulse : VolumeControl } } private bool calculate_high_volume_approved() { - int64 now = GLib.get_monotonic_time(); - return (_high_volume_approved_at != 0) - && (_high_volume_approved_at + _high_volume_approved_ttl_usec >= now); + int64 now = GLib.get_monotonic_time(); + return (_high_volume_approved_at != 0) + && (_high_volume_approved_at + _high_volume_approved_ttl_usec >= now); } public override void approve_high_volume() { _high_volume_approved_at = GLib.get_monotonic_time(); diff --git a/src/volume-control.vala b/src/volume-control.vala index 4efa85f..6efac35 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -46,14 +46,14 @@ public abstract class VolumeControl : Object public virtual bool high_volume_approved { get { return false; } protected set { } } public virtual void approve_high_volume() { } - public virtual void clamp_to_high_volume() { } + public virtual void clamp_to_high_volume() { } public abstract void set_mute (bool mute); - public void set_volume_clamp (double unclamped, VolumeControl.VolumeReasons reason) { - var v = new VolumeControl.Volume(); - v.volume = unclamped.clamp (0.0, this.max_volume); - v.reason = reason; - this.volume = v; - } + public void set_volume_clamp (double unclamped, VolumeControl.VolumeReasons reason) { + var v = new VolumeControl.Volume(); + v.volume = unclamped.clamp (0.0, this.max_volume); + v.reason = reason; + this.volume = v; + } } |