| 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 #include "media/midi/midi_manager_usb.h" | 5 #include "media/midi/midi_manager_usb.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "media/midi/midi_scheduler.h" | 12 #include "media/midi/midi_scheduler.h" |
| 13 #include "media/midi/usb_midi_descriptor_parser.h" | 13 #include "media/midi/usb_midi_descriptor_parser.h" |
| 14 | 14 |
| 15 namespace midi { | 15 namespace midi { |
| 16 | 16 |
| 17 using mojom::Result; |
| 18 |
| 17 MidiManagerUsb::MidiManagerUsb(std::unique_ptr<UsbMidiDevice::Factory> factory) | 19 MidiManagerUsb::MidiManagerUsb(std::unique_ptr<UsbMidiDevice::Factory> factory) |
| 18 : device_factory_(std::move(factory)) {} | 20 : device_factory_(std::move(factory)) {} |
| 19 | 21 |
| 20 MidiManagerUsb::~MidiManagerUsb() { | 22 MidiManagerUsb::~MidiManagerUsb() { |
| 21 base::AutoLock auto_lock(scheduler_lock_); | 23 base::AutoLock auto_lock(scheduler_lock_); |
| 22 CHECK(!scheduler_); | 24 CHECK(!scheduler_); |
| 23 } | 25 } |
| 24 | 26 |
| 25 void MidiManagerUsb::StartInitialization() { | 27 void MidiManagerUsb::StartInitialization() { |
| 26 Initialize( | 28 Initialize( |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 DCHECK_EQ(jacks[j].direction(), UsbMidiJack::DIRECTION_IN); | 161 DCHECK_EQ(jacks[j].direction(), UsbMidiJack::DIRECTION_IN); |
| 160 input_stream_->Add(jacks[j]); | 162 input_stream_->Add(jacks[j]); |
| 161 AddInputPort(MidiPortInfo(id, manufacturer, product_name, version, | 163 AddInputPort(MidiPortInfo(id, manufacturer, product_name, version, |
| 162 MIDI_PORT_OPENED)); | 164 MIDI_PORT_OPENED)); |
| 163 } | 165 } |
| 164 } | 166 } |
| 165 return true; | 167 return true; |
| 166 } | 168 } |
| 167 | 169 |
| 168 } // namespace midi | 170 } // namespace midi |
| OLD | NEW |