OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/chromeos/audio_handler.h" | 5 #include "chrome/browser/chromeos/audio_handler.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
11 #include "chrome/browser/browser_thread.h" | |
12 #include "chrome/browser/chromeos/audio_mixer_alsa.h" | 11 #include "chrome/browser/chromeos/audio_mixer_alsa.h" |
13 #include "chrome/browser/chromeos/audio_mixer_pulse.h" | 12 #include "chrome/browser/chromeos/audio_mixer_pulse.h" |
| 13 #include "content/browser/browser_thread.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 const double kMinVolumeDb = -90.0; | 19 const double kMinVolumeDb = -90.0; |
20 // Choosing 6.0dB here instead of 0dB to give user chance to amplify audio some | 20 // Choosing 6.0dB here instead of 0dB to give user chance to amplify audio some |
21 // in case sounds or their setup is too quiet for them. | 21 // in case sounds or their setup is too quiet for them. |
22 const double kMaxVolumeDb = 6.0; | 22 const double kMaxVolumeDb = 6.0; |
23 // A value of less than one adjusts quieter volumes in larger steps (giving | 23 // A value of less than one adjusts quieter volumes in larger steps (giving |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 return pow(volume_percent / 100.0, kVolumeBias) * | 233 return pow(volume_percent / 100.0, kVolumeBias) * |
234 (max_volume_db_ - min_volume_db_) + min_volume_db_; | 234 (max_volume_db_ - min_volume_db_) + min_volume_db_; |
235 } | 235 } |
236 | 236 |
237 // static | 237 // static |
238 AudioHandler* AudioHandler::GetInstance() { | 238 AudioHandler* AudioHandler::GetInstance() { |
239 return Singleton<AudioHandler>::get(); | 239 return Singleton<AudioHandler>::get(); |
240 } | 240 } |
241 | 241 |
242 } // namespace chromeos | 242 } // namespace chromeos |
OLD | NEW |