Chromium Code Reviews| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 // This call can be invoked from I/O thread or UI thread because | 148 // This call can be invoked from I/O thread or UI thread because |
| 149 // it does not need to access CrasAudioClient on DBus. | 149 // it does not need to access CrasAudioClient on DBus. |
| 150 virtual void GetAudioDevices(AudioDeviceList* device_list) const; | 150 virtual void GetAudioDevices(AudioDeviceList* device_list) const; |
| 151 | 151 |
| 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 levels 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 levels to |volume_percent|, whose | |
| 163 // range is from 0-100%, without notifying observers. | |
| 164 virtual void SetOutputVolumePercentWithoutNotifyingObservers( | |
| 165 int volume_percent); | |
| 166 | |
| 162 // Sets all active input devices' gain level to |gain_percent|, whose range is | 167 // Sets all active input devices' gain level to |gain_percent|, whose range is |
| 163 // from 0-100%. | 168 // from 0-100%. |
| 164 virtual void SetInputGainPercent(int gain_percent); | 169 virtual void SetInputGainPercent(int gain_percent); |
| 165 | 170 |
| 166 // Adjusts all active output devices' volume up (positive percentage) or down | 171 // Adjusts all active output devices' volume up (positive percentage) or down |
| 167 // (negative percentage). | 172 // (negative percentage). |
| 168 virtual void AdjustOutputVolumeByPercent(int adjust_by_percent); | 173 virtual void AdjustOutputVolumeByPercent(int adjust_by_percent); |
| 169 | 174 |
| 170 // Adjusts all active output devices' volume to a minimum audible level if it | 175 // Adjusts all active output devices' volume to a minimum audible level if it |
| 171 // is too low. | 176 // is too low. |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 425 // Failures are not logged at startup, since CRAS may not be running yet. | 430 // Failures are not logged at startup, since CRAS may not be running yet. |
| 426 bool log_errors_; | 431 bool log_errors_; |
| 427 | 432 |
| 428 // Timer for HDMI re-discovering grace period. | 433 // Timer for HDMI re-discovering grace period. |
| 429 base::OneShotTimer hdmi_rediscover_timer_; | 434 base::OneShotTimer hdmi_rediscover_timer_; |
| 430 int hdmi_rediscover_grace_period_duration_in_ms_; | 435 int hdmi_rediscover_grace_period_duration_in_ms_; |
| 431 bool hdmi_rediscovering_; | 436 bool hdmi_rediscovering_; |
| 432 | 437 |
| 433 bool cras_service_available_ = false; | 438 bool cras_service_available_ = false; |
| 434 | 439 |
| 435 bool initializing_audio_state_ = false; | 440 // A mask with non-zero value indicates it is an automated volume changed. |
|
Daniel Erat
2016/07/29 17:53:38
please document the name of the enum that is used
Qiang(Joe) Xu
2016/07/29 18:58:23
Done.
| |
| 441 int automated_volume_change_ = 0; | |
| 442 | |
| 436 int init_volume_; | 443 int init_volume_; |
| 437 uint64_t init_node_id_; | 444 uint64_t init_node_id_; |
| 438 int init_volume_count_ = 0; | 445 int init_volume_count_ = 0; |
| 439 | 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 |