~xavi-garcia-mena/indicator-sound/check-mpris-properties

« back to all changes in this revision

Viewing changes to src/volume-control-pulse.vala

  • Committer: Ted Gould
  • Date: 2015-04-17 17:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 493.
  • Revision ID: ted@gould.cx-20150417171028-uca6pdnvs0yrpaec
Always record the volume whether we do something with it or not

Show diffs side-by-side

added added

removed removed

Lines of Context:
616
616
                        return _volume;
617
617
                }
618
618
                set {
619
 
                        if (value.volume != _volume.volume) {
620
 
                                debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason);
621
 
 
622
 
                                var old_high_volume = this.high_volume;
623
 
                                _volume = value;
624
 
 
625
 
                                /* Make sure we're connected to Pulse and pulse didn't give us the change */
626
 
                                if (context.get_state () == Context.State.READY &&
627
 
                                                _volume.reason != VolumeControl.VolumeReasons.PULSE_CHANGE)
628
 
                                        if (_pulse_use_stream_restore)
629
 
                                                set_volume_active_role.begin ();
630
 
                                        else
631
 
                                                context.get_server_info (server_info_cb_for_set_volume);
632
 
 
633
 
                                if (this.high_volume != old_high_volume)
634
 
                                        this.notify_property("high-volume");
635
 
 
636
 
                                if (volume.reason != VolumeControl.VolumeReasons.ACCOUNTS_SERVICE_SET)
637
 
                                        start_local_volume_timer();
 
619
                        var volume_changed = (value.volume != _volume.volume);
 
620
                        debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason);
 
621
 
 
622
                        var old_high_volume = this.high_volume;
 
623
                        _volume = value;
 
624
 
 
625
                        /* Make sure we're connected to Pulse and pulse didn't give us the change */
 
626
                        if (context.get_state () == Context.State.READY &&
 
627
                                        _volume.reason != VolumeControl.VolumeReasons.PULSE_CHANGE &&
 
628
                                        volume_changed)
 
629
                                if (_pulse_use_stream_restore)
 
630
                                        set_volume_active_role.begin ();
 
631
                                else
 
632
                                        context.get_server_info (server_info_cb_for_set_volume);
 
633
 
 
634
                        if (this.high_volume != old_high_volume)
 
635
                                this.notify_property("high-volume");
 
636
 
 
637
                        if (volume.reason != VolumeControl.VolumeReasons.ACCOUNTS_SERVICE_SET
 
638
                                && volume_changed) {
 
639
                                start_local_volume_timer();
638
640
                        }
639
641
                }
640
642
        }