OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef MEDIA_MIDI_MIDI_MANAGER_MAC_H_ | 5 #ifndef MEDIA_MIDI_MIDI_MANAGER_MAC_H_ |
6 #define MEDIA_MIDI_MIDI_MANAGER_MAC_H_ | 6 #define MEDIA_MIDI_MIDI_MANAGER_MAC_H_ |
7 | 7 |
8 #include <CoreMIDI/MIDIServices.h> | 8 #include <CoreMIDI/MIDIServices.h> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "media/midi/midi_manager.h" | 17 #include "media/midi/midi_manager.h" |
18 #include "media/midi/midi_port_info.h" | 18 #include "media/midi/midi_port_info.h" |
19 | 19 |
20 namespace media { | 20 namespace media { |
21 | 21 |
22 class MEDIA_EXPORT MidiManagerMac : public MidiManager { | 22 class MEDIA_EXPORT MidiManagerMac : public MidiManager { |
23 public: | 23 public: |
24 MidiManagerMac(); | 24 MidiManagerMac(); |
25 virtual ~MidiManagerMac(); | 25 ~MidiManagerMac() override; |
26 | 26 |
27 // MidiManager implementation. | 27 // MidiManager implementation. |
28 virtual void StartInitialization() override; | 28 void StartInitialization() override; |
29 virtual void DispatchSendMidiData(MidiManagerClient* client, | 29 void DispatchSendMidiData(MidiManagerClient* client, |
30 uint32 port_index, | 30 uint32 port_index, |
31 const std::vector<uint8>& data, | 31 const std::vector<uint8>& data, |
32 double timestamp) override; | 32 double timestamp) override; |
33 | 33 |
34 private: | 34 private: |
35 // Runs a closure on |client_thread_|. It starts the thread if it isn't | 35 // Runs a closure on |client_thread_|. It starts the thread if it isn't |
36 // running and the destructor isn't called. | 36 // running and the destructor isn't called. |
37 // Caller can bind base::Unretained(this) to |closure| since we join | 37 // Caller can bind base::Unretained(this) to |closure| since we join |
38 // |client_thread_| in the destructor. | 38 // |client_thread_| in the destructor. |
39 void RunOnClientThread(const base::Closure& closure); | 39 void RunOnClientThread(const base::Closure& closure); |
40 | 40 |
41 // Initializes CoreMIDI on |client_thread_| asynchronously. Called from | 41 // Initializes CoreMIDI on |client_thread_| asynchronously. Called from |
42 // StartInitialization(). | 42 // StartInitialization(). |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // Sets true on destructing object to avoid starting |client_thread_| again. | 81 // Sets true on destructing object to avoid starting |client_thread_| again. |
82 bool shutdown_; | 82 bool shutdown_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(MidiManagerMac); | 84 DISALLOW_COPY_AND_ASSIGN(MidiManagerMac); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace media | 87 } // namespace media |
88 | 88 |
89 #endif // MEDIA_MIDI_MIDI_MANAGER_MAC_H_ | 89 #endif // MEDIA_MIDI_MIDI_MANAGER_MAC_H_ |
OLD | NEW |