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