OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 5 #ifndef CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
6 #define CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 6 #define CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <queue> | 10 #include <queue> |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 virtual bool GetPrimaryActiveOutputDevice(AudioDevice* device) const; | 152 virtual bool GetPrimaryActiveOutputDevice(AudioDevice* device) const; |
153 | 153 |
154 // Whether there is alternative input/output audio device. | 154 // Whether there is alternative input/output audio device. |
155 virtual bool has_alternative_input() const; | 155 virtual bool has_alternative_input() const; |
156 virtual bool has_alternative_output() const; | 156 virtual bool has_alternative_output() const; |
157 | 157 |
158 // Sets all active output devices' volume level to |volume_percent|, whose | 158 // Sets all active output devices' volume level to |volume_percent|, whose |
159 // range is from 0-100%. | 159 // range is from 0-100%. |
160 virtual void SetOutputVolumePercent(int volume_percent); | 160 virtual void SetOutputVolumePercent(int volume_percent); |
161 | 161 |
162 // Sets all active output devices' volume level to |volume_percent|, whose | |
163 // range is from 0-100% from internal sources, not users. | |
164 virtual void SetOutputVolumePercentInternally(int volume_percent); | |
jennyz
2016/07/28 21:02:17
Sorry, the name is a little confusing here(my faul
Qiang(Joe) Xu
2016/07/28 23:15:57
Done.
| |
165 | |
162 // Sets all active input devices' gain level to |gain_percent|, whose range is | 166 // Sets all active input devices' gain level to |gain_percent|, whose range is |
163 // from 0-100%. | 167 // from 0-100%. |
164 virtual void SetInputGainPercent(int gain_percent); | 168 virtual void SetInputGainPercent(int gain_percent); |
165 | 169 |
166 // Adjusts all active output devices' volume up (positive percentage) or down | 170 // Adjusts all active output devices' volume up (positive percentage) or down |
167 // (negative percentage). | 171 // (negative percentage). |
168 virtual void AdjustOutputVolumeByPercent(int adjust_by_percent); | 172 virtual void AdjustOutputVolumeByPercent(int adjust_by_percent); |
169 | 173 |
170 // Adjusts all active output devices' volume to a minimum audible level if it | 174 // Adjusts all active output devices' volume to a minimum audible level if it |
171 // is too low. | 175 // is too low. |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
430 int hdmi_rediscover_grace_period_duration_in_ms_; | 434 int hdmi_rediscover_grace_period_duration_in_ms_; |
431 bool hdmi_rediscovering_; | 435 bool hdmi_rediscovering_; |
432 | 436 |
433 bool cras_service_available_ = false; | 437 bool cras_service_available_ = false; |
434 | 438 |
435 bool initializing_audio_state_ = false; | 439 bool initializing_audio_state_ = false; |
436 int init_volume_; | 440 int init_volume_; |
437 uint64_t init_node_id_; | 441 uint64_t init_node_id_; |
438 int init_volume_count_ = 0; | 442 int init_volume_count_ = 0; |
439 | 443 |
444 // True if volume change event is not coming from user-initiated operations. | |
445 bool volume_internally_changed_ = false; | |
446 | |
440 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; | 447 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; |
441 | 448 |
442 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); | 449 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); |
443 }; | 450 }; |
444 | 451 |
445 } // namespace chromeos | 452 } // namespace chromeos |
446 | 453 |
447 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 454 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
OLD | NEW |