Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: chromeos/audio/cras_audio_handler.h

Issue 2190773002: Fix Volume slider is captured in screenshot done in touchview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: not using default parameter Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
Daniel Erat 2016/07/28 23:57:53 nit: s/level/levels/
Qiang(Joe) Xu 2016/07/29 04:30:32 Done.
163 // range is from 0-100%, but indicating that this will not notify observers.
Daniel Erat 2016/07/28 23:57:52 nit: change "but indicating that this will not not
Qiang(Joe) Xu 2016/07/29 04:30:32 Done.
164 virtual void SetOutputVolumePercentInQuietMode(int volume_percent);
Daniel Erat 2016/07/28 23:57:52 "InQuietMode" seems a bit confusing, since we're a
Qiang(Joe) Xu 2016/07/29 04:30:32 done by adding SetOutputVolumePercentWithoutNotify
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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 // Failures are not logged at startup, since CRAS may not be running yet. 429 // Failures are not logged at startup, since CRAS may not be running yet.
426 bool log_errors_; 430 bool log_errors_;
427 431
428 // Timer for HDMI re-discovering grace period. 432 // Timer for HDMI re-discovering grace period.
429 base::OneShotTimer hdmi_rediscover_timer_; 433 base::OneShotTimer hdmi_rediscover_timer_;
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 // A mask to indicate if a volume change is initiated by user.
Daniel Erat 2016/07/28 23:57:53 nit: document "A mask of NonUserVolumeChangeReason
Qiang(Joe) Xu 2016/07/29 04:30:32 Done.
440 int volume_change_not_by_user_ = 0;
Daniel Erat 2016/07/28 23:57:53 nit: non_user_volume_change_reasons_; (but see nam
Qiang(Joe) Xu 2016/07/29 04:30:32 Done.
441
436 int init_volume_; 442 int init_volume_;
437 uint64_t init_node_id_; 443 uint64_t init_node_id_;
438 int init_volume_count_ = 0; 444 int init_volume_count_ = 0;
439 445
440 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; 446 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_;
441 447
442 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); 448 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler);
443 }; 449 };
444 450
445 } // namespace chromeos 451 } // namespace chromeos
446 452
447 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ 453 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698