~mterry/indicator-sound/snap-root

« back to all changes in this revision

Viewing changes to src/volume-control.vala

  • Committer: CI Train Bot
  • Author(s): Xavi Garcia Mena
  • Date: 2016-01-05 15:08:24 UTC
  • mfrom: (509.2.16 indicator-sound-action-sync)
  • Revision ID: ci-train-bot@canonical.com-20160105150824-1njwom14qewljjlh
Adds an action to signal the UI to sync the current volume when we are waiting for the user to confirm or reject the high volume notification. Fixes: #1512798, #1520548
Approved by: PS Jenkins bot, Charles Kerr, Nick Dedekind

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        public virtual bool ready { get { return false; } set { } }
50
50
        public virtual bool active_mic { get { return false; } set { } }
51
51
        public virtual bool high_volume { get { return false; } protected set { } }
 
52
        public virtual bool ignore_high_volume { get { return false; } protected set { } }
52
53
        public virtual bool below_warning_volume { get { return false; } protected set { } }    
53
54
        public virtual bool mute { get { return false; } }
54
55
        public virtual bool is_playing { get { return false; } }
55
56
        public virtual VolumeControl.ActiveOutput active_output { get { return VolumeControl.ActiveOutput.SPEAKERS; } }
56
57
        private Volume _volume;
 
58
        private double _pre_clamp_volume;
57
59
        public virtual Volume volume { get { return _volume; } set { } }
58
60
        public virtual double mic_volume { get { return 0.0; } set { } }
59
61
        public virtual double max_volume { get { return 1.0; } protected set { } }
70
72
                v.volume = unclamped.clamp (0.0, this.max_volume);
71
73
                v.reason = reason;
72
74
                this.volume = v;
 
75
                _pre_clamp_volume = unclamped;
 
76
        }
 
77
 
 
78
        public double get_pre_clamped_volume () {
 
79
                return _pre_clamp_volume;
73
80
        }
74
81
 
75
82
        public signal void active_output_changed (VolumeControl.ActiveOutput active_output);