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 CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ |
6 #define CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ | 6 #define CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/public/browser/browser_message_filter.h" | 16 #include "content/public/browser/browser_message_filter.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "media/midi/midi_manager.h" | 18 #include "media/midi/midi_manager.h" |
| 19 #include "media/midi/midi_port_info.h" |
19 | 20 |
20 namespace media { | 21 namespace media { |
21 class MidiManager; | 22 class MidiManager; |
22 class MidiMessageQueue; | 23 class MidiMessageQueue; |
23 } | 24 } |
24 | 25 |
25 namespace content { | 26 namespace content { |
26 | 27 |
27 class CONTENT_EXPORT MidiHost | 28 class CONTENT_EXPORT MidiHost |
28 : public BrowserMessageFilter, | 29 : public BrowserMessageFilter, |
29 public media::MidiManagerClient { | 30 public media::MidiManagerClient { |
30 public: | 31 public: |
31 // Called from UI thread from the owner of this object. | 32 // Called from UI thread from the owner of this object. |
32 MidiHost(int renderer_process_id, media::MidiManager* midi_manager); | 33 MidiHost(int renderer_process_id, media::MidiManager* midi_manager); |
33 | 34 |
34 // BrowserMessageFilter implementation. | 35 // BrowserMessageFilter implementation. |
35 void OnDestruct() const override; | 36 void OnDestruct() const override; |
36 bool OnMessageReceived(const IPC::Message& message) override; | 37 bool OnMessageReceived(const IPC::Message& message) override; |
37 | 38 |
38 // MidiManagerClient implementation. | 39 // MidiManagerClient implementation. |
39 void CompleteStartSession(media::MidiResult result) override; | 40 void CompleteStartSession(media::MidiResult result) override; |
40 void AddInputPort(const media::MidiPortInfo& info) override; | 41 void AddInputPort(const media::MidiPortInfo& info) override; |
41 void AddOutputPort(const media::MidiPortInfo& info) override; | 42 void AddOutputPort(const media::MidiPortInfo& info) override; |
| 43 void SetInputPortState(uint32 port, media::MidiPortState state) override; |
| 44 void SetOutputPortState(uint32 port, media::MidiPortState state) override; |
42 void ReceiveMidiData(uint32 port, | 45 void ReceiveMidiData(uint32 port, |
43 const uint8* data, | 46 const uint8* data, |
44 size_t length, | 47 size_t length, |
45 double timestamp) override; | 48 double timestamp) override; |
46 void AccumulateMidiBytesSent(size_t n) override; | 49 void AccumulateMidiBytesSent(size_t n) override; |
47 | 50 |
48 // Start session to access MIDI hardware. | 51 // Start session to access MIDI hardware. |
49 void OnStartSession(); | 52 void OnStartSession(); |
50 | 53 |
51 // Data to be sent to a MIDI output port. | 54 // Data to be sent to a MIDI output port. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 104 |
102 // Protects access to |sent_bytes_in_flight_|. | 105 // Protects access to |sent_bytes_in_flight_|. |
103 base::Lock in_flight_lock_; | 106 base::Lock in_flight_lock_; |
104 | 107 |
105 DISALLOW_COPY_AND_ASSIGN(MidiHost); | 108 DISALLOW_COPY_AND_ASSIGN(MidiHost); |
106 }; | 109 }; |
107 | 110 |
108 } // namespace content | 111 } // namespace content |
109 | 112 |
110 #endif // CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ | 113 #endif // CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ |
OLD | NEW |