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.
5 #ifndef MEDIA_MIDI_USB_MIDI_JACK_H_
6 #define MEDIA_MIDI_USB_MIDI_JACK_H_
8 #include "base/basictypes.h"
9 #include "media/midi/usb_midi_export.h"
16 // UsbMidiJack represents an EMBEDDED MIDI jack.
17 struct USB_MIDI_EXPORT UsbMidiJack
{
18 // The direction of the endpoint associated with an EMBEDDED MIDI jack.
19 // Note that an IN MIDI jack associated with an OUT endpoint has
20 // ***DIRECTION_OUT*** direction.
25 UsbMidiJack(UsbMidiDevice
* device
,
28 uint8 endpoint_address
)
31 cable_number(cable_number
),
32 endpoint_address(endpoint_address
) {}
34 UsbMidiDevice
* device
;
35 // The id of this jack unique in the interface.
37 // The cable number of this jack in the associated endpoint.
39 // The address of the endpoint that this jack is associated with.
40 uint8 endpoint_address
;
42 Direction
direction() const {
43 return (endpoint_address
& 0x80) ? DIRECTION_IN
: DIRECTION_OUT
;
45 uint8
endpoint_number() const {
46 return (endpoint_address
& 0xf);
53 #endif // MEDIA_MIDI_USB_MIDI_JACK_H_