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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 return AUDIO_TYPE_POST_MIX_LOOPBACK; | 102 return AUDIO_TYPE_POST_MIX_LOOPBACK; |
103 else if (node_type.find("POST_DSP_LOOPBACK") != std::string::npos) | 103 else if (node_type.find("POST_DSP_LOOPBACK") != std::string::npos) |
104 return AUDIO_TYPE_POST_DSP_LOOPBACK; | 104 return AUDIO_TYPE_POST_DSP_LOOPBACK; |
105 else | 105 else |
106 return AUDIO_TYPE_OTHER; | 106 return AUDIO_TYPE_OTHER; |
107 } | 107 } |
108 | 108 |
109 AudioDevice::AudioDevice() | 109 AudioDevice::AudioDevice() |
110 : is_input(false), | 110 : is_input(false), |
111 id(0), | 111 id(0), |
112 stable_device_id(0), | |
112 display_name(""), | 113 display_name(""), |
113 type(AUDIO_TYPE_OTHER), | 114 type(AUDIO_TYPE_OTHER), |
114 priority(0), | 115 priority(0), |
115 active(false), | 116 active(false), |
116 plugged_time(0) { | 117 plugged_time(0) { |
117 } | 118 } |
118 | 119 |
119 AudioDevice::AudioDevice(const AudioNode& node) { | 120 AudioDevice::AudioDevice(const AudioNode& node) { |
120 is_input = node.is_input; | 121 is_input = node.is_input; |
121 id = node.id; | 122 id = node.id; |
123 stable_device_id = node.stable_device_id; | |
122 type = GetAudioType(node.type); | 124 type = GetAudioType(node.type); |
123 if (!node.name.empty() && node.name != "(default)") | 125 if (!node.name.empty() && node.name != "(default)") |
124 display_name = node.name; | 126 display_name = node.name; |
125 else | 127 else |
126 display_name = node.device_name; | 128 display_name = node.device_name; |
127 device_name = node.device_name; | 129 device_name = node.device_name; |
128 mic_positions = node.mic_positions; | 130 mic_positions = node.mic_positions; |
129 priority = GetDevicePriority(type, node.is_input); | 131 priority = GetDevicePriority(type, node.is_input); |
130 active = node.active; | 132 active = node.active; |
131 plugged_time = node.plugged_time; | 133 plugged_time = node.plugged_time; |
(...skipping 16 matching lines...) Expand all Loading... | |
148 base::StringAppendF(&result, | 150 base::StringAppendF(&result, |
149 "type = %s ", | 151 "type = %s ", |
150 GetTypeString(type).c_str()); | 152 GetTypeString(type).c_str()); |
151 base::StringAppendF(&result, | 153 base::StringAppendF(&result, |
152 "active = %s ", | 154 "active = %s ", |
153 active ? "true" : "false"); | 155 active ? "true" : "false"); |
154 base::StringAppendF(&result, | 156 base::StringAppendF(&result, |
155 "plugged_time= %s ", | 157 "plugged_time= %s ", |
156 base::Uint64ToString(plugged_time).c_str()); | 158 base::Uint64ToString(plugged_time).c_str()); |
157 base::StringAppendF(&result, "mic_positions = %s ", mic_positions.c_str()); | 159 base::StringAppendF(&result, "mic_positions = %s ", mic_positions.c_str()); |
160 base::StringAppendF(&result, "stable_device_id = %lu ", | |
161 stable_device_id); | |
jennyz
2016/01/05 23:46:55
nit: how about moving this after line 143 to keep
hychao
2016/01/06 06:34:12
Done.
| |
158 | 162 |
159 return result; | 163 return result; |
160 } | 164 } |
161 | 165 |
162 } // namespace chromeos | 166 } // namespace chromeos |
OLD | NEW |