OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_USB_MIDI_JACK_H_ | 5 #ifndef MEDIA_MIDI_USB_MIDI_JACK_H_ |
6 #define MEDIA_MIDI_USB_MIDI_JACK_H_ | 6 #define MEDIA_MIDI_USB_MIDI_JACK_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "media/midi/usb_midi_export.h" | 9 #include "media/midi/usb_midi_export.h" |
10 | 10 |
11 namespace media { | 11 namespace media { |
| 12 namespace midi { |
12 | 13 |
13 class UsbMidiDevice; | 14 class UsbMidiDevice; |
14 | 15 |
15 // UsbMidiJack represents an EMBEDDED MIDI jack. | 16 // UsbMidiJack represents an EMBEDDED MIDI jack. |
16 struct USB_MIDI_EXPORT UsbMidiJack { | 17 struct USB_MIDI_EXPORT UsbMidiJack { |
17 // The direction of the endpoint associated with an EMBEDDED MIDI jack. | 18 // The direction of the endpoint associated with an EMBEDDED MIDI jack. |
18 // Note that an IN MIDI jack associated with an OUT endpoint has | 19 // Note that an IN MIDI jack associated with an OUT endpoint has |
19 // ***DIRECTION_OUT*** direction. | 20 // ***DIRECTION_OUT*** direction. |
20 enum Direction { | 21 enum Direction { |
21 DIRECTION_IN, | 22 DIRECTION_IN, |
(...skipping 17 matching lines...) Expand all Loading... |
39 uint8 endpoint_address; | 40 uint8 endpoint_address; |
40 | 41 |
41 Direction direction() const { | 42 Direction direction() const { |
42 return (endpoint_address & 0x80) ? DIRECTION_IN : DIRECTION_OUT; | 43 return (endpoint_address & 0x80) ? DIRECTION_IN : DIRECTION_OUT; |
43 } | 44 } |
44 uint8 endpoint_number() const { | 45 uint8 endpoint_number() const { |
45 return (endpoint_address & 0xf); | 46 return (endpoint_address & 0xf); |
46 } | 47 } |
47 }; | 48 }; |
48 | 49 |
| 50 } // namespace midi |
49 } // namespace media | 51 } // namespace media |
50 | 52 |
51 #endif // MEDIA_MIDI_USB_MIDI_JACK_H_ | 53 #endif // MEDIA_MIDI_USB_MIDI_JACK_H_ |
OLD | NEW |