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/dbus/audio_node.h" | 5 #include "chromeos/dbus/audio_node.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 | 12 |
11 namespace chromeos { | 13 namespace chromeos { |
12 | 14 |
13 AudioNode::AudioNode() | 15 AudioNode::AudioNode() |
14 : is_input(false), | 16 : is_input(false), |
15 id(0), | 17 id(0), |
16 active(false), | 18 active(false), |
17 plugged_time(0) { | 19 plugged_time(0) { |
18 } | 20 } |
19 | 21 |
20 AudioNode::AudioNode(bool is_input, | 22 AudioNode::AudioNode(bool is_input, |
21 uint64 id, | 23 uint64_t id, |
22 std::string device_name, | 24 std::string device_name, |
23 std::string type, | 25 std::string type, |
24 std::string name, | 26 std::string name, |
25 bool active, | 27 bool active, |
26 uint64 plugged_time) | 28 uint64_t plugged_time) |
27 : is_input(is_input), | 29 : is_input(is_input), |
28 id(id), | 30 id(id), |
29 device_name(device_name), | 31 device_name(device_name), |
30 type(type), | 32 type(type), |
31 name(name), | 33 name(name), |
32 active(active), | 34 active(active), |
33 plugged_time(plugged_time) { | 35 plugged_time(plugged_time) {} |
34 } | |
35 | 36 |
36 AudioNode::~AudioNode() {} | 37 AudioNode::~AudioNode() {} |
37 | 38 |
38 std::string AudioNode::ToString() const { | 39 std::string AudioNode::ToString() const { |
39 std::string result; | 40 std::string result; |
40 base::StringAppendF(&result, | 41 base::StringAppendF(&result, |
41 "is_input = %s ", | 42 "is_input = %s ", |
42 is_input ? "true" : "false"); | 43 is_input ? "true" : "false"); |
43 base::StringAppendF(&result, | 44 base::StringAppendF(&result, |
44 "id = 0x%" PRIx64 " ", | 45 "id = 0x%" PRIx64 " ", |
(...skipping 11 matching lines...) Expand all Loading... |
56 "active = %s ", | 57 "active = %s ", |
57 active ? "true" : "false"); | 58 active ? "true" : "false"); |
58 base::StringAppendF(&result, | 59 base::StringAppendF(&result, |
59 "plugged_time= %s ", | 60 "plugged_time= %s ", |
60 base::Uint64ToString(plugged_time).c_str()); | 61 base::Uint64ToString(plugged_time).c_str()); |
61 | 62 |
62 return result; | 63 return result; |
63 } | 64 } |
64 | 65 |
65 } // namespace chromeos | 66 } // namespace chromeos |
OLD | NEW |