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 "chrome/browser/chromeos/pulse_audio_mixer.h" | 10 #include "chrome/browser/chromeos/pulse_audio_mixer.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 return 100.0 * pow((volume_db - kMinVolumeDb) / | 161 return 100.0 * pow((volume_db - kMinVolumeDb) / |
162 (kMaxVolumeDb - kMinVolumeDb), 1/kVolumeBias); | 162 (kMaxVolumeDb - kMinVolumeDb), 1/kVolumeBias); |
163 } | 163 } |
164 | 164 |
165 // static | 165 // static |
166 double AudioHandler::PercentToVolumeDb(double volume_percent) { | 166 double AudioHandler::PercentToVolumeDb(double volume_percent) { |
167 return pow(volume_percent / 100.0, kVolumeBias) * | 167 return pow(volume_percent / 100.0, kVolumeBias) * |
168 (kMaxVolumeDb - kMinVolumeDb) + kMinVolumeDb; | 168 (kMaxVolumeDb - kMinVolumeDb) + kMinVolumeDb; |
169 } | 169 } |
170 | 170 |
| 171 // static |
| 172 AudioHandler* AudioHandler::instance() { |
| 173 return Singleton<AudioHandler>::get(); |
| 174 } |
| 175 |
171 } // namespace chromeos | 176 } // namespace chromeos |
OLD | NEW |