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

Side by Side Diff: chromeos/dbus/audio_node.h

Issue 2510093003: Handle audio node stable device ID change (Closed)
Patch Set: fix a typo Created 4 years 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/cras_audio_handler_unittest.cc ('k') | chromeos/dbus/audio_node.cc » ('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 #ifndef CHROMEOS_DBUS_AUDIO_NODE_H_ 5 #ifndef CHROMEOS_DBUS_AUDIO_NODE_H_
6 #define CHROMEOS_DBUS_AUDIO_NODE_H_ 6 #define CHROMEOS_DBUS_AUDIO_NODE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "chromeos/chromeos_export.h" 13 #include "chromeos/chromeos_export.h"
14 14
15 namespace chromeos { 15 namespace chromeos {
16 16
17 // Structure to hold AudioNode data received from cras. 17 // Structure to hold AudioNode data received from cras.
18 struct CHROMEOS_EXPORT AudioNode { 18 struct CHROMEOS_EXPORT AudioNode {
19 bool is_input; 19 bool is_input = false;
20 uint64_t id; 20 uint64_t id = 0;
21 uint64_t stable_device_id; 21 bool has_v2_stable_device_id = false;
22 uint64_t stable_device_id_v1 = 0;
23 uint64_t stable_device_id_v2 = 0;
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 std::string mic_positions; 27 std::string mic_positions;
26 bool active; 28 bool active = false;
27 // Time that the node was plugged in. 29 // Time that the node was plugged in.
28 uint64_t plugged_time; 30 uint64_t plugged_time = 0;
29 31
30 AudioNode(); 32 AudioNode();
31 AudioNode(bool is_input, 33 AudioNode(bool is_input,
32 uint64_t id, 34 uint64_t id,
33 uint64_t stable_device_id, 35 bool has_v2_stable_device_id,
36 uint64_t stable_device_id_v1,
37 uint64_t stable_device_id_v2,
34 std::string device_name, 38 std::string device_name,
35 std::string type, 39 std::string type,
36 std::string name, 40 std::string name,
37 bool active, 41 bool active,
38 uint64_t plugged_time); 42 uint64_t plugged_time);
39 AudioNode(const AudioNode& other); 43 AudioNode(const AudioNode& other);
40 ~AudioNode(); 44 ~AudioNode();
45
41 std::string ToString() const; 46 std::string ToString() const;
47 int StableDeviceIdVersion() const;
48 uint64_t StableDeviceId() const;
42 }; 49 };
43 50
44 typedef std::vector<AudioNode> AudioNodeList; 51 typedef std::vector<AudioNode> AudioNodeList;
45 52
46 } // namespace chromeos 53 } // namespace chromeos
47 54
48 #endif // CHROMEOS_DBUS_AUDIO_NODE_H_ 55 #endif // CHROMEOS_DBUS_AUDIO_NODE_H_
OLDNEW
« no previous file with comments | « chromeos/audio/cras_audio_handler_unittest.cc ('k') | chromeos/dbus/audio_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698