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/midi_manager_alsa.h" | 5 #include "media/midi/midi_manager_alsa.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <poll.h> | 8 #include <poll.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "base/strings/string_number_conversions.h" | 25 #include "base/strings/string_number_conversions.h" |
26 #include "base/strings/stringprintf.h" | 26 #include "base/strings/stringprintf.h" |
27 #include "base/time/time.h" | 27 #include "base/time/time.h" |
28 #include "crypto/sha2.h" | 28 #include "crypto/sha2.h" |
29 #include "media/midi/midi_port_info.h" | 29 #include "media/midi/midi_port_info.h" |
30 | 30 |
31 namespace midi { | 31 namespace midi { |
32 | 32 |
33 namespace { | 33 namespace { |
34 | 34 |
| 35 using midi::mojom::Result; |
| 36 |
35 // Per-output buffer. This can be smaller, but then large sysex messages | 37 // Per-output buffer. This can be smaller, but then large sysex messages |
36 // will be (harmlessly) split across multiple seq events. This should | 38 // will be (harmlessly) split across multiple seq events. This should |
37 // not have any real practical effect, except perhaps to slightly reorder | 39 // not have any real practical effect, except perhaps to slightly reorder |
38 // realtime messages with respect to sysex. | 40 // realtime messages with respect to sysex. |
39 const size_t kSendBufferSize = 256; | 41 const size_t kSendBufferSize = 256; |
40 | 42 |
41 // Minimum client id for which we will have ALSA card devices for. When we | 43 // Minimum client id for which we will have ALSA card devices for. When we |
42 // are searching for card devices (used to get the path, id, and manufacturer), | 44 // are searching for card devices (used to get the path, id, and manufacturer), |
43 // we don't want to get confused by kernel clients that do not have a card. | 45 // we don't want to get confused by kernel clients that do not have a card. |
44 // See seq_clientmgr.c in the ALSA code for this. | 46 // See seq_clientmgr.c in the ALSA code for this. |
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1396 // Update our map. | 1398 // Update our map. |
1397 source_map_[AddrToInt(client_id, port_id)] = port_index; | 1399 source_map_[AddrToInt(client_id, port_id)] = port_index; |
1398 return true; | 1400 return true; |
1399 } | 1401 } |
1400 | 1402 |
1401 MidiManager* MidiManager::Create() { | 1403 MidiManager* MidiManager::Create() { |
1402 return new MidiManagerAlsa(); | 1404 return new MidiManagerAlsa(); |
1403 } | 1405 } |
1404 | 1406 |
1405 } // namespace midi | 1407 } // namespace midi |
OLD | NEW |