| 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> |
| 8 |
| 7 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 8 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 11 | 13 |
| 12 namespace chromeos { | 14 namespace chromeos { |
| 13 | 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 // Get the priority for a particular device type. The priority returned | 18 // Get the priority for a particular device type. The priority returned |
| 17 // will be between 0 to 3, the higher number meaning a higher priority. | 19 // will be between 0 to 3, the higher number meaning a higher priority. |
| 18 uint8 GetDevicePriority(AudioDeviceType type, bool is_input) { | 20 uint8_t GetDevicePriority(AudioDeviceType type, bool is_input) { |
| 19 // Lower the priority of bluetooth mic to prevent unexpected bad eperience | 21 // Lower the priority of bluetooth mic to prevent unexpected bad eperience |
| 20 // to user because of bluetooth audio profile switching. Make priority to | 22 // to user because of bluetooth audio profile switching. Make priority to |
| 21 // zero so this mic will never be automatically chosen. | 23 // zero so this mic will never be automatically chosen. |
| 22 if (type == AUDIO_TYPE_BLUETOOTH && is_input) | 24 if (type == AUDIO_TYPE_BLUETOOTH && is_input) |
| 23 return 0; | 25 return 0; |
| 24 switch (type) { | 26 switch (type) { |
| 25 case AUDIO_TYPE_HEADPHONE: | 27 case AUDIO_TYPE_HEADPHONE: |
| 26 case AUDIO_TYPE_MIC: | 28 case AUDIO_TYPE_MIC: |
| 27 case AUDIO_TYPE_USB: | 29 case AUDIO_TYPE_USB: |
| 28 case AUDIO_TYPE_BLUETOOTH: | 30 case AUDIO_TYPE_BLUETOOTH: |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 active ? "true" : "false"); | 153 active ? "true" : "false"); |
| 152 base::StringAppendF(&result, | 154 base::StringAppendF(&result, |
| 153 "plugged_time= %s ", | 155 "plugged_time= %s ", |
| 154 base::Uint64ToString(plugged_time).c_str()); | 156 base::Uint64ToString(plugged_time).c_str()); |
| 155 base::StringAppendF(&result, "mic_positions = %s ", mic_positions.c_str()); | 157 base::StringAppendF(&result, "mic_positions = %s ", mic_positions.c_str()); |
| 156 | 158 |
| 157 return result; | 159 return result; |
| 158 } | 160 } |
| 159 | 161 |
| 160 } // namespace chromeos | 162 } // namespace chromeos |
| OLD | NEW |