Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: media/midi/midi_manager.h

Issue 1177973003: [Web MIDI] Use Android MIDI API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/midi/midi_jni_registrar.cc ('k') | media/midi/midi_manager_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 base::TimeTicks time) { 144 base::TimeTicks time) {
145 ReceiveMidiData(port_index, data, length, 145 ReceiveMidiData(port_index, data, length,
146 (time - base::TimeTicks()).InSecondsF()); 146 (time - base::TimeTicks()).InSecondsF());
147 } 147 }
148 148
149 size_t clients_size_for_testing() const { return clients_.size(); } 149 size_t clients_size_for_testing() const { return clients_.size(); }
150 size_t pending_clients_size_for_testing() const { 150 size_t pending_clients_size_for_testing() const {
151 return pending_clients_.size(); 151 return pending_clients_.size();
152 } 152 }
153 153
154 const MidiPortInfoList& input_ports() const { return input_ports_; }
155 const MidiPortInfoList& output_ports() const { return output_ports_; }
156
154 private: 157 private:
155 void CompleteInitializationInternal(Result result); 158 void CompleteInitializationInternal(Result result);
156 void AddInitialPorts(MidiManagerClient* client); 159 void AddInitialPorts(MidiManagerClient* client);
157 160
158 // Keeps track of all clients who wish to receive MIDI data. 161 // Keeps track of all clients who wish to receive MIDI data.
159 typedef std::set<MidiManagerClient*> ClientSet; 162 typedef std::set<MidiManagerClient*> ClientSet;
160 ClientSet clients_; 163 ClientSet clients_;
161 164
162 // Keeps track of all clients who are waiting for CompleteStartSession(). 165 // Keeps track of all clients who are waiting for CompleteStartSession().
163 ClientSet pending_clients_; 166 ClientSet pending_clients_;
(...skipping 17 matching lines...) Expand all
181 // |result_|, |input_ports_| and |output_ports_|. 184 // |result_|, |input_ports_| and |output_ports_|.
182 base::Lock lock_; 185 base::Lock lock_;
183 186
184 DISALLOW_COPY_AND_ASSIGN(MidiManager); 187 DISALLOW_COPY_AND_ASSIGN(MidiManager);
185 }; 188 };
186 189
187 } // namespace midi 190 } // namespace midi
188 } // namespace media 191 } // namespace media
189 192
190 #endif // MEDIA_MIDI_MIDI_MANAGER_H_ 193 #endif // MEDIA_MIDI_MIDI_MANAGER_H_
OLDNEW
« no previous file with comments | « media/midi/midi_jni_registrar.cc ('k') | media/midi/midi_manager_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698