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

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

Issue 1275783003: Add a virtual beamforming audio device on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix more constructors and disable for now. 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
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_AUDIO_AUDIO_DEVICE_H_ 5 #ifndef CHROMEOS_AUDIO_AUDIO_DEVICE_H_
6 #define CHROMEOS_AUDIO_AUDIO_DEVICE_H_ 6 #define CHROMEOS_AUDIO_AUDIO_DEVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 bool is_input; 58 bool is_input;
59 uint64 id; 59 uint64 id;
60 std::string display_name; 60 std::string display_name;
61 std::string device_name; 61 std::string device_name;
62 AudioDeviceType type; 62 AudioDeviceType type;
63 uint8 priority; 63 uint8 priority;
64 bool active; 64 bool active;
65 uint64 plugged_time; 65 uint64 plugged_time;
66 std::string mic_positions;
66 }; 67 };
67 68
68 typedef std::vector<AudioDevice> AudioDeviceList; 69 typedef std::vector<AudioDevice> AudioDeviceList;
69 typedef std::map<uint64, AudioDevice> AudioDeviceMap; 70 typedef std::map<uint64, AudioDevice> AudioDeviceMap;
70 71
71 struct AudioDeviceCompare { 72 struct AudioDeviceCompare {
72 // Rules used to discern which device is higher, 73 // Rules used to discern which device is higher,
73 // 1.) Device Type: 74 // 1.) Device Type:
74 // [Headphones/USB/Bluetooh > HDMI > Internal Speakers] 75 // [Headphones/USB/Bluetooh > HDMI > Internal Speakers]
75 // [External Mic/USB Mic/Bluetooth > Internal Mic] 76 // [External Mic/USB Mic/Bluetooth > Internal Mic]
76 // 2.) Device Plugged in Time: 77 // 2.) Device Plugged in Time:
77 // [Later > Earlier] 78 // [Later > Earlier]
78 bool operator()(const chromeos::AudioDevice& a, 79 bool operator()(const chromeos::AudioDevice& a,
79 const chromeos::AudioDevice& b) const { 80 const chromeos::AudioDevice& b) const {
80 if (a.priority < b.priority) { 81 if (a.priority < b.priority) {
81 return true; 82 return true;
82 } else if (b.priority < a.priority) { 83 } else if (b.priority < a.priority) {
83 return false; 84 return false;
84 } else if (a.plugged_time < b.plugged_time) { 85 } else if (a.plugged_time < b.plugged_time) {
85 return true; 86 return true;
86 } else { 87 } else {
87 return false; 88 return false;
88 } 89 }
89 } 90 }
90 }; 91 };
91 92
92 } // namespace chromeos 93 } // namespace chromeos
93 94
94 #endif // CHROMEOS_AUDIO_AUDIO_DEVICE_H_ 95 #endif // CHROMEOS_AUDIO_AUDIO_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698