| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_MIDI_MIDI_MANAGER_WINRT_H_ |
| 6 #define MEDIA_MIDI_MIDI_MANAGER_WINRT_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/threading/thread.h" |
| 11 #include "media/midi/midi_manager.h" |
| 12 #include "media/midi/midi_scheduler.h" |
| 13 |
| 14 namespace media { |
| 15 namespace midi { |
| 16 |
| 17 class MIDI_EXPORT MidiManagerWinrt final : public MidiManager { |
| 18 public: |
| 19 MidiManagerWinrt(); |
| 20 ~MidiManagerWinrt() override; |
| 21 |
| 22 // MidiManager overrides: |
| 23 void StartInitialization() final; |
| 24 void Finalize() final; |
| 25 void DispatchSendMidiData(MidiManagerClient* client, |
| 26 uint32_t port_index, |
| 27 const std::vector<uint8_t>& data, |
| 28 double timestamp) final; |
| 29 |
| 30 private: |
| 31 // Callbacks on the COM thread. |
| 32 void AssertOnComThread(); |
| 33 void InitializeOnComThread(); |
| 34 void PostSendDataTaskOnComThread(MidiManagerClient* client, |
| 35 uint32_t port_index, |
| 36 const std::vector<uint8_t>& data, |
| 37 double timestamp); |
| 38 void SendOnComThread(uint32_t port_index, const std::vector<uint8_t>& data); |
| 39 |
| 40 // Subclasses that access protected members of MidiManager. |
| 41 class MidiInPortManager; |
| 42 class MidiOutPortManager; |
| 43 |
| 44 std::unique_ptr<MidiInPortManager> port_manager_in_; |
| 45 std::unique_ptr<MidiOutPortManager> port_manager_out_; |
| 46 |
| 47 std::unique_ptr<MidiScheduler> scheduler_; |
| 48 |
| 49 // COM-initialized thread for calling WinRT methods. |
| 50 base::Thread com_thread_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(MidiManagerWinrt); |
| 53 }; |
| 54 |
| 55 } // namespace midi |
| 56 } // namespace media |
| 57 |
| 58 #endif // MEDIA_MIDI_MIDI_MANAGER_WINRT_H_ |
| OLD | NEW |