Chromium Code Reviews| 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 <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 // and the client is registered to receive MIDI data. | 79 // and the client is registered to receive MIDI data. |
| 80 // CompleteStartSession() is called with MIDI_OK if the session is started. | 80 // CompleteStartSession() is called with MIDI_OK if the session is started. |
| 81 // Otherwise CompleteStartSession() is called with proper MidiResult code. | 81 // Otherwise CompleteStartSession() is called with proper MidiResult code. |
| 82 // StartSession() and EndSession() can be called on the Chrome_IOThread. | 82 // StartSession() and EndSession() can be called on the Chrome_IOThread. |
| 83 // CompleteStartSession() will be invoked on the same Chrome_IOThread. | 83 // CompleteStartSession() will be invoked on the same Chrome_IOThread. |
| 84 void StartSession(MidiManagerClient* client); | 84 void StartSession(MidiManagerClient* client); |
| 85 | 85 |
| 86 // A client calls EndSession() to stop receiving MIDI data. | 86 // A client calls EndSession() to stop receiving MIDI data. |
| 87 void EndSession(MidiManagerClient* client); | 87 void EndSession(MidiManagerClient* client); |
| 88 | 88 |
| 89 // Invoke AccumulateMidiBytesSent() for |client| safely. If the session was | |
| 90 // already close, do nothing. | |
|
yhirano
2015/04/07 12:06:33
closed?
Takashi Toyoshima
2015/04/07 12:50:48
Done.
| |
| 91 void AccumulateMidiBytesSent(MidiManagerClient* client, size_t n); | |
| 92 | |
| 89 // DispatchSendMidiData() is called when MIDI data should be sent to the MIDI | 93 // DispatchSendMidiData() is called when MIDI data should be sent to the MIDI |
| 90 // system. | 94 // system. |
| 91 // This method is supposed to return immediately and should not block. | 95 // This method is supposed to return immediately and should not block. |
| 92 // |port_index| represents the specific output port from output_ports(). | 96 // |port_index| represents the specific output port from output_ports(). |
| 93 // |data| represents a series of bytes encoding one or more MIDI messages. | 97 // |data| represents a series of bytes encoding one or more MIDI messages. |
| 94 // |length| is the number of bytes in |data|. | 98 // |length| is the number of bytes in |data|. |
| 95 // |timestamp| is the time to send the data, in seconds. A value of 0 | 99 // |timestamp| is the time to send the data, in seconds. A value of 0 |
| 96 // means send "now" or as soon as possible. | 100 // means send "now" or as soon as possible. |
| 97 // The default implementation is for unsupported platforms. | 101 // The default implementation is for unsupported platforms. |
| 98 virtual void DispatchSendMidiData(MidiManagerClient* client, | 102 virtual void DispatchSendMidiData(MidiManagerClient* client, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 // Protects access to |clients_|, |pending_clients_|, |initialized_|, | 179 // Protects access to |clients_|, |pending_clients_|, |initialized_|, |
| 176 // |result_|, |input_ports_| and |output_ports_|. | 180 // |result_|, |input_ports_| and |output_ports_|. |
| 177 base::Lock lock_; | 181 base::Lock lock_; |
| 178 | 182 |
| 179 DISALLOW_COPY_AND_ASSIGN(MidiManager); | 183 DISALLOW_COPY_AND_ASSIGN(MidiManager); |
| 180 }; | 184 }; |
| 181 | 185 |
| 182 } // namespace media | 186 } // namespace media |
| 183 | 187 |
| 184 #endif // MEDIA_MIDI_MIDI_MANAGER_H_ | 188 #endif // MEDIA_MIDI_MIDI_MANAGER_H_ |
| OLD | NEW |