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

Unified Diff: media/midi/usb_midi_jack.h

Issue 105043008: Introduce USB MIDI descriptor parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 side-by-side diff with in-line comments
Download patch
Index: media/midi/usb_midi_jack.h
diff --git a/media/midi/usb_midi_jack.h b/media/midi/usb_midi_jack.h
new file mode 100644
index 0000000000000000000000000000000000000000..9adce50912f96f3694df3e2f69d0ee108e42088f
--- /dev/null
+++ b/media/midi/usb_midi_jack.h
@@ -0,0 +1,51 @@
+// Copyright 2013 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_JACK_H_
+#define MEDIA_MIDI_USB_MIDI_JACK_H_
+
+#include "base/basictypes.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+class UsbMidiDevice;
+
+// UsbMidiJack represents an EMBEDDED MIDI jack.
+struct MEDIA_EXPORT UsbMidiJack {
DaleCurtis 2014/01/10 01:55:57 Class? If you think other classes will use your J
yhirano 2014/01/10 02:30:32 A jack is fully identified with (device, endpoint_
+ // The direction of the endpoint associated with an EMBEDDED MIDI jack.
+ // Note that an IN MIDI jack associated with an OUT endpoint has
+ // ***OUT*** direction.
+ enum Direction {
+ IN,
+ OUT,
+ };
+ UsbMidiJack(UsbMidiDevice* device,
+ uint8 jack_id,
+ uint8 cable_number,
+ uint8 endpoint_address)
+ : device(device),
+ jack_id(jack_id),
+ cable_number(cable_number),
+ endpoint_address(endpoint_address) {}
+ // Not owned
+ UsbMidiDevice* device;
+ // The id of this jack unique in the interface.
+ uint8 jack_id;
+ // The cable number of this jack in the associated endpoint.
+ uint8 cable_number;
+ // The address of the endpoint that this jack is associated with.
+ uint8 endpoint_address;
+
+ Direction direction() const {
+ return (endpoint_address & 0x80) ? IN : OUT;
+ }
+ uint8 endpoint_number() const {
+ return (endpoint_address & 0xf);
+ }
+};
+
+} // namespace media
+
+#endif // MEDIA_MIDI_USB_MIDI_JACK_H_
« media/midi/usb_midi_descriptor_parser.cc ('K') | « media/midi/usb_midi_descriptor_parser_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698