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 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 // This flag can be used as the signal that when background tasks must be | 1130 // This flag can be used as the signal that when background tasks must be |
1131 // interrupted. | 1131 // interrupted. |
1132 // TODO(toyoshim): Use std::atomic<bool> when it is allowed. | 1132 // TODO(toyoshim): Use std::atomic<bool> when it is allowed. |
1133 volatile bool destructor_started; | 1133 volatile bool destructor_started; |
1134 | 1134 |
1135 DISALLOW_COPY_AND_ASSIGN(MidiServiceWinImpl); | 1135 DISALLOW_COPY_AND_ASSIGN(MidiServiceWinImpl); |
1136 }; | 1136 }; |
1137 | 1137 |
1138 } // namespace | 1138 } // namespace |
1139 | 1139 |
1140 MidiManagerWin::MidiManagerWin() { | 1140 MidiManagerWin::MidiManagerWin(MidiService* service) : MidiManager(service) {} |
1141 } | |
1142 | 1141 |
1143 MidiManagerWin::~MidiManagerWin() { | 1142 MidiManagerWin::~MidiManagerWin() { |
1144 } | 1143 } |
1145 | 1144 |
1146 void MidiManagerWin::StartInitialization() { | 1145 void MidiManagerWin::StartInitialization() { |
1147 midi_service_.reset(new MidiServiceWinImpl); | 1146 midi_service_.reset(new MidiServiceWinImpl); |
1148 // Note that |CompleteInitialization()| will be called from the callback. | 1147 // Note that |CompleteInitialization()| will be called from the callback. |
1149 midi_service_->InitializeAsync(this); | 1148 midi_service_->InitializeAsync(this); |
1150 } | 1149 } |
1151 | 1150 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 PortState state) { | 1192 PortState state) { |
1194 SetOutputPortState(port_index, state); | 1193 SetOutputPortState(port_index, state); |
1195 } | 1194 } |
1196 | 1195 |
1197 void MidiManagerWin::OnReceiveMidiData(uint32_t port_index, | 1196 void MidiManagerWin::OnReceiveMidiData(uint32_t port_index, |
1198 const std::vector<uint8_t>& data, | 1197 const std::vector<uint8_t>& data, |
1199 base::TimeTicks time) { | 1198 base::TimeTicks time) { |
1200 ReceiveMidiData(port_index, &data[0], data.size(), time); | 1199 ReceiveMidiData(port_index, &data[0], data.size(), time); |
1201 } | 1200 } |
1202 | 1201 |
1203 MidiManager* MidiManager::Create() { | 1202 MidiManager* MidiManager::Create(MidiService* service) { |
1204 if (base::FeatureList::IsEnabled(features::kMidiManagerWinrt) && | 1203 if (base::FeatureList::IsEnabled(features::kMidiManagerWinrt) && |
1205 base::win::GetVersion() >= base::win::VERSION_WIN10) | 1204 base::win::GetVersion() >= base::win::VERSION_WIN10) |
1206 return new MidiManagerWinrt(); | 1205 return new MidiManagerWinrt(service); |
1207 return new MidiManagerWin(); | 1206 return new MidiManagerWin(service); |
1208 } | 1207 } |
1209 | 1208 |
1210 } // namespace midi | 1209 } // namespace midi |
OLD | NEW |