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_H_ | 5 #ifndef MEDIA_MIDI_MIDI_MANAGER_H_ |
6 #define MEDIA_MIDI_MIDI_MANAGER_H_ | 6 #define MEDIA_MIDI_MIDI_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // AccumulateMidiBytesSent() is called to acknowledge when bytes have | 43 // AccumulateMidiBytesSent() is called to acknowledge when bytes have |
44 // successfully been sent to the hardware. | 44 // successfully been sent to the hardware. |
45 // This happens as a result of the client having previously called | 45 // This happens as a result of the client having previously called |
46 // MidiManager::DispatchSendMidiData(). | 46 // MidiManager::DispatchSendMidiData(). |
47 virtual void AccumulateMidiBytesSent(size_t n) = 0; | 47 virtual void AccumulateMidiBytesSent(size_t n) = 0; |
48 }; | 48 }; |
49 | 49 |
50 // Manages access to all MIDI hardware. | 50 // Manages access to all MIDI hardware. |
51 class MEDIA_EXPORT MidiManager { | 51 class MEDIA_EXPORT MidiManager { |
52 public: | 52 public: |
53 static MidiManager* Create(); | 53 static const size_t kMaxPendingClientCount = 128; |
54 | 54 |
55 MidiManager(); | 55 MidiManager(); |
56 virtual ~MidiManager(); | 56 virtual ~MidiManager(); |
57 | 57 |
| 58 static MidiManager* Create(); |
| 59 |
58 // A client calls StartSession() to receive and send MIDI data. | 60 // A client calls StartSession() to receive and send MIDI data. |
59 // If the session is ready to start, the MIDI system is lazily initialized | 61 // If the session is ready to start, the MIDI system is lazily initialized |
60 // and the client is registered to receive MIDI data. | 62 // and the client is registered to receive MIDI data. |
61 // CompleteStartSession() is called with MIDI_OK if the session is started. | 63 // CompleteStartSession() is called with MIDI_OK if the session is started. |
62 // Otherwise CompleteStartSession() is called with proper MidiResult code. | 64 // Otherwise CompleteStartSession() is called with proper MidiResult code. |
63 void StartSession(MidiManagerClient* client, int client_id); | 65 void StartSession(MidiManagerClient* client, int client_id); |
64 | 66 |
65 // A client calls EndSession() to stop receiving MIDI data. | 67 // A client calls EndSession() to stop receiving MIDI data. |
66 void EndSession(MidiManagerClient* client); | 68 void EndSession(MidiManagerClient* client); |
67 | 69 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 MidiPortInfoList input_ports_; | 142 MidiPortInfoList input_ports_; |
141 MidiPortInfoList output_ports_; | 143 MidiPortInfoList output_ports_; |
142 | 144 |
143 private: | 145 private: |
144 DISALLOW_COPY_AND_ASSIGN(MidiManager); | 146 DISALLOW_COPY_AND_ASSIGN(MidiManager); |
145 }; | 147 }; |
146 | 148 |
147 } // namespace media | 149 } // namespace media |
148 | 150 |
149 #endif // MEDIA_MIDI_MIDI_MANAGER_H_ | 151 #endif // MEDIA_MIDI_MIDI_MANAGER_H_ |
OLD | NEW |