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 #include "chromeos/audio/audio_device.h" | 5 #include "chromeos/audio/audio_device.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 "active = %s ", | 179 "active = %s ", |
180 active ? "true" : "false"); | 180 active ? "true" : "false"); |
181 base::StringAppendF(&result, | 181 base::StringAppendF(&result, |
182 "plugged_time= %s ", | 182 "plugged_time= %s ", |
183 base::Uint64ToString(plugged_time).c_str()); | 183 base::Uint64ToString(plugged_time).c_str()); |
184 base::StringAppendF(&result, "mic_positions = %s ", mic_positions.c_str()); | 184 base::StringAppendF(&result, "mic_positions = %s ", mic_positions.c_str()); |
185 | 185 |
186 return result; | 186 return result; |
187 } | 187 } |
188 | 188 |
| 189 bool AudioDevice::IsExternalDevice() const { |
| 190 if (!is_for_simple_usage()) |
| 191 return false; |
| 192 |
| 193 if (is_input) { |
| 194 return (type != AUDIO_TYPE_INTERNAL_MIC && type != AUDIO_TYPE_FRONT_MIC && |
| 195 type != AUDIO_TYPE_REAR_MIC); |
| 196 } else { |
| 197 return (type != AUDIO_TYPE_INTERNAL_SPEAKER); |
| 198 } |
| 199 } |
| 200 |
189 } // namespace chromeos | 201 } // namespace chromeos |
OLD | NEW |