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_MIDI_MANAGER_USB_H_ | 5 #ifndef MEDIA_MIDI_MIDI_MANAGER_USB_H_ |
6 #define MEDIA_MIDI_MIDI_MANAGER_USB_H_ | 6 #define MEDIA_MIDI_MIDI_MANAGER_USB_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | |
12 #include "base/bind.h" | 11 #include "base/bind.h" |
13 #include "base/callback.h" | 12 #include "base/callback.h" |
14 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
15 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
16 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
17 #include "base/time/time.h" | 16 #include "base/time/time.h" |
18 #include "media/midi/midi_manager.h" | 17 #include "media/midi/midi_manager.h" |
19 #include "media/midi/usb_midi_device.h" | 18 #include "media/midi/usb_midi_device.h" |
20 #include "media/midi/usb_midi_export.h" | 19 #include "media/midi/usb_midi_export.h" |
21 #include "media/midi/usb_midi_input_stream.h" | 20 #include "media/midi/usb_midi_input_stream.h" |
(...skipping 10 matching lines...) Expand all Loading... |
32 : public MidiManager, | 31 : public MidiManager, |
33 public UsbMidiDeviceDelegate, | 32 public UsbMidiDeviceDelegate, |
34 NON_EXPORTED_BASE(public UsbMidiInputStream::Delegate) { | 33 NON_EXPORTED_BASE(public UsbMidiInputStream::Delegate) { |
35 public: | 34 public: |
36 explicit MidiManagerUsb(scoped_ptr<UsbMidiDevice::Factory> device_factory); | 35 explicit MidiManagerUsb(scoped_ptr<UsbMidiDevice::Factory> device_factory); |
37 ~MidiManagerUsb() override; | 36 ~MidiManagerUsb() override; |
38 | 37 |
39 // MidiManager implementation. | 38 // MidiManager implementation. |
40 void StartInitialization() override; | 39 void StartInitialization() override; |
41 void DispatchSendMidiData(MidiManagerClient* client, | 40 void DispatchSendMidiData(MidiManagerClient* client, |
42 uint32 port_index, | 41 uint32_t port_index, |
43 const std::vector<uint8>& data, | 42 const std::vector<uint8_t>& data, |
44 double timestamp) override; | 43 double timestamp) override; |
45 | 44 |
46 // UsbMidiDeviceDelegate implementation. | 45 // UsbMidiDeviceDelegate implementation. |
47 void ReceiveUsbMidiData(UsbMidiDevice* device, | 46 void ReceiveUsbMidiData(UsbMidiDevice* device, |
48 int endpoint_number, | 47 int endpoint_number, |
49 const uint8* data, | 48 const uint8_t* data, |
50 size_t size, | 49 size_t size, |
51 base::TimeTicks time) override; | 50 base::TimeTicks time) override; |
52 void OnDeviceAttached(scoped_ptr<UsbMidiDevice> device) override; | 51 void OnDeviceAttached(scoped_ptr<UsbMidiDevice> device) override; |
53 void OnDeviceDetached(size_t index) override; | 52 void OnDeviceDetached(size_t index) override; |
54 | 53 |
55 // UsbMidiInputStream::Delegate implementation. | 54 // UsbMidiInputStream::Delegate implementation. |
56 void OnReceivedData(size_t jack_index, | 55 void OnReceivedData(size_t jack_index, |
57 const uint8* data, | 56 const uint8_t* data, |
58 size_t size, | 57 size_t size, |
59 base::TimeTicks time) override; | 58 base::TimeTicks time) override; |
60 | 59 |
61 const ScopedVector<UsbMidiOutputStream>& output_streams() const { | 60 const ScopedVector<UsbMidiOutputStream>& output_streams() const { |
62 return output_streams_; | 61 return output_streams_; |
63 } | 62 } |
64 const UsbMidiInputStream* input_stream() const { return input_stream_.get(); } | 63 const UsbMidiInputStream* input_stream() const { return input_stream_.get(); } |
65 | 64 |
66 // Initializes this object. | 65 // Initializes this object. |
67 // When the initialization finishes, |callback| will be called with the | 66 // When the initialization finishes, |callback| will be called with the |
(...skipping 20 matching lines...) Expand all Loading... |
88 | 87 |
89 scoped_ptr<MidiScheduler> scheduler_; | 88 scoped_ptr<MidiScheduler> scheduler_; |
90 | 89 |
91 DISALLOW_COPY_AND_ASSIGN(MidiManagerUsb); | 90 DISALLOW_COPY_AND_ASSIGN(MidiManagerUsb); |
92 }; | 91 }; |
93 | 92 |
94 } // namespace midi | 93 } // namespace midi |
95 } // namespace media | 94 } // namespace media |
96 | 95 |
97 #endif // MEDIA_MIDI_MIDI_MANAGER_USB_H_ | 96 #endif // MEDIA_MIDI_MIDI_MANAGER_USB_H_ |
OLD | NEW |