Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Side by Side Diff: chromeos/audio/audio_device.cc

Issue 1320923005: Fill in mic_positions property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/audio/audio_device.h ('k') | chromeos/dbus/audio_node.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 AudioDevice::AudioDevice(const AudioNode& node) { 117 AudioDevice::AudioDevice(const AudioNode& node) {
118 is_input = node.is_input; 118 is_input = node.is_input;
119 id = node.id; 119 id = node.id;
120 type = GetAudioType(node.type); 120 type = GetAudioType(node.type);
121 if (!node.name.empty() && node.name != "(default)") 121 if (!node.name.empty() && node.name != "(default)")
122 display_name = node.name; 122 display_name = node.name;
123 else 123 else
124 display_name = node.device_name; 124 display_name = node.device_name;
125 device_name = node.device_name; 125 device_name = node.device_name;
126 mic_positions = node.mic_positions;
126 priority = GetDevicePriority(type, node.is_input); 127 priority = GetDevicePriority(type, node.is_input);
127 active = node.active; 128 active = node.active;
128 plugged_time = node.plugged_time; 129 plugged_time = node.plugged_time;
129 } 130 }
130 131
131 std::string AudioDevice::ToString() const { 132 std::string AudioDevice::ToString() const {
132 std::string result; 133 std::string result;
133 base::StringAppendF(&result, 134 base::StringAppendF(&result,
134 "is_input = %s ", 135 "is_input = %s ",
135 is_input ? "true" : "false"); 136 is_input ? "true" : "false");
136 base::StringAppendF(&result, 137 base::StringAppendF(&result,
137 "id = 0x%" PRIx64 " ", 138 "id = 0x%" PRIx64 " ",
138 id); 139 id);
139 base::StringAppendF(&result, 140 base::StringAppendF(&result,
140 "display_name = %s ", 141 "display_name = %s ",
141 display_name.c_str()); 142 display_name.c_str());
142 base::StringAppendF(&result, 143 base::StringAppendF(&result,
143 "device_name = %s ", 144 "device_name = %s ",
144 device_name.c_str()); 145 device_name.c_str());
145 base::StringAppendF(&result, 146 base::StringAppendF(&result,
146 "type = %s ", 147 "type = %s ",
147 GetTypeString(type).c_str()); 148 GetTypeString(type).c_str());
148 base::StringAppendF(&result, 149 base::StringAppendF(&result,
149 "active = %s ", 150 "active = %s ",
150 active ? "true" : "false"); 151 active ? "true" : "false");
151 base::StringAppendF(&result, 152 base::StringAppendF(&result,
152 "plugged_time= %s ", 153 "plugged_time= %s ",
153 base::Uint64ToString(plugged_time).c_str()); 154 base::Uint64ToString(plugged_time).c_str());
155 base::StringAppendF(&result, "mic_positions = %s ", mic_positions.c_str());
154 156
155 return result; 157 return result;
156 } 158 }
157 159
158 } // namespace chromeos 160 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/audio/audio_device.h ('k') | chromeos/dbus/audio_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698