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

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

Issue 107163008: [WebMIDI] Introduce MidiManagerUsb (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-midi-stream
Patch Set: Created 6 years, 10 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
« no previous file with comments | « media/midi/usb_midi_input_stream.cc ('k') | media/midi/usb_midi_output_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/media_export.h" 9 #include "media/base/media_export.h"
10 10
11 namespace media { 11 namespace media {
12 12
13 class UsbMidiDevice; 13 class UsbMidiDevice;
14 14
15 // UsbMidiJack represents an EMBEDDED MIDI jack. 15 // UsbMidiJack represents an EMBEDDED MIDI jack.
16 struct MEDIA_EXPORT UsbMidiJack { 16 struct MEDIA_EXPORT UsbMidiJack {
17 // The direction of the endpoint associated with an EMBEDDED MIDI jack. 17 // The direction of the endpoint associated with an EMBEDDED MIDI jack.
18 // Note that an IN MIDI jack associated with an OUT endpoint has 18 // Note that an IN MIDI jack associated with an OUT endpoint has
19 // ***OUT*** direction. 19 // ***DIRECTION_OUT*** direction.
20 enum Direction { 20 enum Direction {
21 IN, 21 DIRECTION_IN,
22 OUT, 22 DIRECTION_OUT,
23 }; 23 };
24 UsbMidiJack(UsbMidiDevice* device, 24 UsbMidiJack(UsbMidiDevice* device,
25 uint8 jack_id, 25 uint8 jack_id,
26 uint8 cable_number, 26 uint8 cable_number,
27 uint8 endpoint_address) 27 uint8 endpoint_address)
28 : device(device), 28 : device(device),
29 jack_id(jack_id), 29 jack_id(jack_id),
30 cable_number(cable_number), 30 cable_number(cable_number),
31 endpoint_address(endpoint_address) {} 31 endpoint_address(endpoint_address) {}
32 // Not owned 32 // Not owned
33 UsbMidiDevice* device; 33 UsbMidiDevice* device;
34 // The id of this jack unique in the interface. 34 // The id of this jack unique in the interface.
35 uint8 jack_id; 35 uint8 jack_id;
36 // The cable number of this jack in the associated endpoint. 36 // The cable number of this jack in the associated endpoint.
37 uint8 cable_number; 37 uint8 cable_number;
38 // The address of the endpoint that this jack is associated with. 38 // The address of the endpoint that this jack is associated with.
39 uint8 endpoint_address; 39 uint8 endpoint_address;
40 40
41 Direction direction() const { 41 Direction direction() const {
42 return (endpoint_address & 0x80) ? IN : OUT; 42 return (endpoint_address & 0x80) ? DIRECTION_IN : DIRECTION_OUT;
43 } 43 }
44 uint8 endpoint_number() const { 44 uint8 endpoint_number() const {
45 return (endpoint_address & 0xf); 45 return (endpoint_address & 0xf);
46 } 46 }
47 }; 47 };
48 48
49 } // namespace media 49 } // namespace media
50 50
51 #endif // MEDIA_MIDI_USB_MIDI_JACK_H_ 51 #endif // MEDIA_MIDI_USB_MIDI_JACK_H_
OLDNEW
« no previous file with comments | « media/midi/usb_midi_input_stream.cc ('k') | media/midi/usb_midi_output_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698