| 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 <alsa/asoundlib.h> | 7 #include <alsa/asoundlib.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/json/json_string_value_serializer.h" | 13 #include "base/json/json_string_value_serializer.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "base/posix/eintr_wrapper.h" | 18 #include "base/posix/eintr_wrapper.h" |
| 19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
| 21 #include "base/threading/thread.h" | 21 #include "base/threading/thread.h" |
| 22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 23 #include "base/values.h" | 23 #include "base/values.h" |
| 24 #include "crypto/sha2.h" | 24 #include "crypto/sha2.h" |
| 25 #include "media/midi/midi_port_info.h" | 25 #include "media/midi/midi_port_info.h" |
| 26 | 26 |
| 27 namespace media { | 27 namespace media { |
| 28 namespace midi { |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 | 31 |
| 31 // Per-output buffer. This can be smaller, but then large sysex messages | 32 // Per-output buffer. This can be smaller, but then large sysex messages |
| 32 // will be (harmlessly) split across multiple seq events. This should | 33 // will be (harmlessly) split across multiple seq events. This should |
| 33 // not have any real practical effect, except perhaps to slightly reorder | 34 // not have any real practical effect, except perhaps to slightly reorder |
| 34 // realtime messages with respect to sysex. | 35 // realtime messages with respect to sysex. |
| 35 const size_t kSendBufferSize = 256; | 36 const size_t kSendBufferSize = 256; |
| 36 | 37 |
| 37 // ALSA constants. | 38 // ALSA constants. |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 | 1010 |
| 1010 // Update our map. | 1011 // Update our map. |
| 1011 source_map_[AddrToInt(client_id, port_id)] = port_index; | 1012 source_map_[AddrToInt(client_id, port_id)] = port_index; |
| 1012 return true; | 1013 return true; |
| 1013 } | 1014 } |
| 1014 | 1015 |
| 1015 MidiManager* MidiManager::Create() { | 1016 MidiManager* MidiManager::Create() { |
| 1016 return new MidiManagerAlsa(); | 1017 return new MidiManagerAlsa(); |
| 1017 } | 1018 } |
| 1018 | 1019 |
| 1020 } // namespace midi |
| 1019 } // namespace media | 1021 } // namespace media |
| OLD | NEW |