| 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> |
| 11 // Prevent unnecessary functions from being included from <mmsystem.h> | 11 // Prevent unnecessary functions from being included from <mmsystem.h> |
| 12 #define MMNODRV | 12 #define MMNODRV |
| 13 #define MMNOSOUND | 13 #define MMNOSOUND |
| 14 #define MMNOWAVE | 14 #define MMNOWAVE |
| 15 #define MMNOAUX | 15 #define MMNOAUX |
| 16 #define MMNOMIXER | 16 #define MMNOMIXER |
| 17 #define MMNOTIMER | 17 #define MMNOTIMER |
| 18 #define MMNOJOY | 18 #define MMNOJOY |
| 19 #define MMNOMCI | 19 #define MMNOMCI |
| 20 #define MMNOMMIO | 20 #define MMNOMMIO |
| 21 #include <mmsystem.h> | 21 #include <mmsystem.h> |
| 22 #include <stddef.h> | 22 #include <stddef.h> |
| 23 | 23 |
| 24 #include <algorithm> | 24 #include <algorithm> |
| 25 #include <functional> | 25 #include <functional> |
| 26 #include <queue> | 26 #include <queue> |
| 27 #include <string> | 27 #include <string> |
| 28 | 28 |
| 29 #include "base/bind.h" | 29 #include "base/bind.h" |
| 30 #include "base/command_line.h" | |
| 31 #include "base/containers/hash_tables.h" | 30 #include "base/containers/hash_tables.h" |
| 31 #include "base/feature_list.h" |
| 32 #include "base/macros.h" | 32 #include "base/macros.h" |
| 33 #include "base/message_loop/message_loop.h" | 33 #include "base/message_loop/message_loop.h" |
| 34 #include "base/single_thread_task_runner.h" | 34 #include "base/single_thread_task_runner.h" |
| 35 #include "base/strings/string16.h" | 35 #include "base/strings/string16.h" |
| 36 #include "base/strings/string_number_conversions.h" | 36 #include "base/strings/string_number_conversions.h" |
| 37 #include "base/strings/string_piece.h" | 37 #include "base/strings/string_piece.h" |
| 38 #include "base/strings/stringprintf.h" | 38 #include "base/strings/stringprintf.h" |
| 39 #include "base/strings/utf_string_conversions.h" | 39 #include "base/strings/utf_string_conversions.h" |
| 40 #include "base/system_monitor/system_monitor.h" | 40 #include "base/system_monitor/system_monitor.h" |
| 41 #include "base/threading/thread_checker.h" | 41 #include "base/threading/thread_checker.h" |
| (...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 SetOutputPortState(port_index, state); | 1186 SetOutputPortState(port_index, state); |
| 1187 } | 1187 } |
| 1188 | 1188 |
| 1189 void MidiManagerWin::OnReceiveMidiData(uint32_t port_index, | 1189 void MidiManagerWin::OnReceiveMidiData(uint32_t port_index, |
| 1190 const std::vector<uint8_t>& data, | 1190 const std::vector<uint8_t>& data, |
| 1191 base::TimeTicks time) { | 1191 base::TimeTicks time) { |
| 1192 ReceiveMidiData(port_index, &data[0], data.size(), time); | 1192 ReceiveMidiData(port_index, &data[0], data.size(), time); |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 MidiManager* MidiManager::Create() { | 1195 MidiManager* MidiManager::Create() { |
| 1196 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1196 if (base::FeatureList::IsEnabled(features::kMidiManagerWinrt) && |
| 1197 switches::kUseWinrtMidiApi) && | |
| 1198 base::win::GetVersion() >= base::win::VERSION_WIN10) | 1197 base::win::GetVersion() >= base::win::VERSION_WIN10) |
| 1199 return new MidiManagerWinrt(); | 1198 return new MidiManagerWinrt(); |
| 1200 return new MidiManagerWin(); | 1199 return new MidiManagerWin(); |
| 1201 } | 1200 } |
| 1202 | 1201 |
| 1203 } // namespace midi | 1202 } // namespace midi |
| 1204 } // namespace media | 1203 } // namespace media |
| OLD | NEW |