| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "media/midi/midi_manager_win.h" | 5 #include "media/midi/midi_manager_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <ks.h> | 8 #include <ks.h> |
| 9 #include <ksmedia.h> | 9 #include <ksmedia.h> |
| 10 #include <mmreg.h> | 10 #include <mmreg.h> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #include "base/threading/thread_checker.h" | 40 #include "base/threading/thread_checker.h" |
| 41 #include "base/timer/timer.h" | 41 #include "base/timer/timer.h" |
| 42 #include "base/win/message_window.h" | 42 #include "base/win/message_window.h" |
| 43 #include "device/usb/usb_ids.h" | 43 #include "device/usb/usb_ids.h" |
| 44 #include "media/midi/midi_manager.h" | 44 #include "media/midi/midi_manager.h" |
| 45 #include "media/midi/midi_message_queue.h" | 45 #include "media/midi/midi_message_queue.h" |
| 46 #include "media/midi/midi_message_util.h" | 46 #include "media/midi/midi_message_util.h" |
| 47 #include "media/midi/midi_port_info.h" | 47 #include "media/midi/midi_port_info.h" |
| 48 | 48 |
| 49 namespace media { | 49 namespace media { |
| 50 namespace midi { |
| 50 namespace { | 51 namespace { |
| 51 | 52 |
| 52 static const size_t kBufferLength = 32 * 1024; | 53 static const size_t kBufferLength = 32 * 1024; |
| 53 | 54 |
| 54 // We assume that nullpter represents an invalid MIDI handle. | 55 // We assume that nullpter represents an invalid MIDI handle. |
| 55 const HMIDIIN kInvalidMidiInHandle = nullptr; | 56 const HMIDIIN kInvalidMidiInHandle = nullptr; |
| 56 const HMIDIOUT kInvalidMidiOutHandle = nullptr; | 57 const HMIDIOUT kInvalidMidiOutHandle = nullptr; |
| 57 | 58 |
| 58 std::string GetInErrorMessage(MMRESULT result) { | 59 std::string GetInErrorMessage(MMRESULT result) { |
| 59 wchar_t text[MAXERRORLENGTH]; | 60 wchar_t text[MAXERRORLENGTH]; |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 void MidiManagerWin::OnReceiveMidiData(uint32 port_index, | 1160 void MidiManagerWin::OnReceiveMidiData(uint32 port_index, |
| 1160 const std::vector<uint8>& data, | 1161 const std::vector<uint8>& data, |
| 1161 base::TimeTicks time) { | 1162 base::TimeTicks time) { |
| 1162 ReceiveMidiData(port_index, &data[0], data.size(), time); | 1163 ReceiveMidiData(port_index, &data[0], data.size(), time); |
| 1163 } | 1164 } |
| 1164 | 1165 |
| 1165 MidiManager* MidiManager::Create() { | 1166 MidiManager* MidiManager::Create() { |
| 1166 return new MidiManagerWin(); | 1167 return new MidiManagerWin(); |
| 1167 } | 1168 } |
| 1168 | 1169 |
| 1170 } // namespace midi |
| 1169 } // namespace media | 1171 } // namespace media |
| OLD | NEW |