Chromium Code Reviews| Index: media/midi/usb_midi_device.h |
| diff --git a/media/midi/usb_midi_device.h b/media/midi/usb_midi_device.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1adc14c6458dca97290c327d163181c6573bd2d0 |
| --- /dev/null |
| +++ b/media/midi/usb_midi_device.h |
| @@ -0,0 +1,54 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_MIDI_USB_MIDI_DEVICE_H_ |
| +#define MEDIA_MIDI_USB_MIDI_DEVICE_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/callback.h" |
| +#include "base/memory/scoped_vector.h" |
| +#include "media/base/media_export.h" |
| + |
| +namespace media { |
| + |
| +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.
|
| + public: |
| + virtual ~UsbMidiDeviceDelegate() {} |
| + virtual void ReceiveUsbMidiData(int endpoint_number, |
| + const uint8* data, |
| + size_t size, |
| + double timestamp) = 0; |
| +}; |
| + |
| +class MEDIA_EXPORT UsbMidiDevice { |
|
scherkus (not reviewing)
2014/01/16 21:55:52
class needs docs
yhirano
2014/01/20 09:12:19
Done.
|
| + public: |
| + typedef ScopedVector<UsbMidiDevice> Devices; |
| + 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.
|
| + public: |
| + typedef base::Callback<void(bool result, Devices* devices)> Callback; |
| + virtual ~Factory() {} |
| + // Enumerates devices. |
| + // Devices that have no USB-MIDI interfaces can be omitted. |
| + // When the operation succeeds, |callback| will be called with |true| and |
| + // devices. |
| + // Otherwise |callback| will be called with |false| and an empty devices. |
| + // When this factory is destroyed during the operation, the operation |
| + // will be canceled silently (i.e. |callback| will not be called). |
| + virtual void EnumerateDevices(Callback callback) = 0; |
| + }; |
| + |
| + virtual ~UsbMidiDevice() {} |
| + |
| + // Returns the descriptor of this device. |
| + virtual std::vector<uint8> GetDescriptor() = 0; |
| + |
| + // Sends |data| to the given USB endpoint of this device. |
| + virtual void Send(int endpoint_number, const std::vector<uint8>& data) = 0; |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_MIDI_USB_MIDI_DEVICE_H_ |