OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/midi/usb_midi_input_stream.h" | 5 #include "media/midi/usb_midi_input_stream.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <map> | |
9 #include <vector> | |
10 | 8 |
11 #include "base/logging.h" | 9 #include "base/logging.h" |
12 #include "media/midi/usb_midi_device.h" | 10 #include "media/midi/usb_midi_device.h" |
13 #include "media/midi/usb_midi_jack.h" | |
14 | 11 |
15 namespace media { | 12 namespace media { |
16 namespace midi { | 13 namespace midi { |
17 | 14 |
18 UsbMidiInputStream::JackUniqueKey::JackUniqueKey(UsbMidiDevice* device, | 15 UsbMidiInputStream::JackUniqueKey::JackUniqueKey(UsbMidiDevice* device, |
19 int endpoint_number, | 16 int endpoint_number, |
20 int cable_number) | 17 int cable_number) |
21 : device(device), | 18 : device(device), |
22 endpoint_number(endpoint_number), | 19 endpoint_number(endpoint_number), |
23 cable_number(cable_number) {} | 20 cable_number(cable_number) {} |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 std::map<JackUniqueKey, size_t>::const_iterator it = | 83 std::map<JackUniqueKey, size_t>::const_iterator it = |
87 jack_dictionary_.find(JackUniqueKey(device, | 84 jack_dictionary_.find(JackUniqueKey(device, |
88 endpoint_number, | 85 endpoint_number, |
89 cable_number)); | 86 cable_number)); |
90 if (it != jack_dictionary_.end()) | 87 if (it != jack_dictionary_.end()) |
91 delegate_->OnReceivedData(it->second, &packet[1], packet_size, time); | 88 delegate_->OnReceivedData(it->second, &packet[1], packet_size, time); |
92 } | 89 } |
93 | 90 |
94 } // namespace midi | 91 } // namespace midi |
95 } // namespace media | 92 } // namespace media |
OLD | NEW |