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

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

Issue 107513012: [WebMIDI] Introduce UsbMidi{Input, Output}Stream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-midi-parser
Patch Set: Created 6 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_MIDI_USB_MIDI_DEVICE_H_
6 #define MEDIA_MIDI_USB_MIDI_DEVICE_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "base/memory/scoped_vector.h"
13 #include "media/base/media_export.h"
14
15 namespace media {
16
17 class MEDIA_EXPORT UsbMidiDeviceDelegate {
scherkus (not reviewing) 2014/01/16 21:55:52 I don't see this class being used anywhere -- can
yhirano 2014/01/20 09:12:19 Done.
18 public:
19 virtual ~UsbMidiDeviceDelegate() {}
20 virtual void ReceiveUsbMidiData(int endpoint_number,
21 const uint8* data,
22 size_t size,
23 double timestamp) = 0;
24 };
25
26 class MEDIA_EXPORT UsbMidiDevice {
scherkus (not reviewing) 2014/01/16 21:55:52 class needs docs
yhirano 2014/01/20 09:12:19 Done.
27 public:
28 typedef ScopedVector<UsbMidiDevice> Devices;
29 class Factory {
scherkus (not reviewing) 2014/01/16 21:55:52 I don't see Factory being used anywhere In genera
yhirano 2014/01/20 09:12:19 Done.
30 public:
31 typedef base::Callback<void(bool result, Devices* devices)> Callback;
32 virtual ~Factory() {}
33 // Enumerates devices.
34 // Devices that have no USB-MIDI interfaces can be omitted.
35 // When the operation succeeds, |callback| will be called with |true| and
36 // devices.
37 // Otherwise |callback| will be called with |false| and an empty devices.
38 // When this factory is destroyed during the operation, the operation
39 // will be canceled silently (i.e. |callback| will not be called).
40 virtual void EnumerateDevices(Callback callback) = 0;
41 };
42
43 virtual ~UsbMidiDevice() {}
44
45 // Returns the descriptor of this device.
46 virtual std::vector<uint8> GetDescriptor() = 0;
47
48 // Sends |data| to the given USB endpoint of this device.
49 virtual void Send(int endpoint_number, const std::vector<uint8>& data) = 0;
50 };
51
52 } // namespace media
53
54 #endif // MEDIA_MIDI_USB_MIDI_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698