| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_mac.h" | 5 #include "media/midi/midi_manager_mac.h" |
| 6 | 6 |
| 7 #include <CoreMIDI/MIDIServices.h> | 7 #include <CoreMIDI/MIDIServices.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 return; | 39 return; |
| 40 | 40 |
| 41 // Check if this is the first call after CompleteStartSession(), and | 41 // Check if this is the first call after CompleteStartSession(), and |
| 42 // the case should not happen twice. | 42 // the case should not happen twice. |
| 43 if (!wait_for_port_) | 43 if (!wait_for_port_) |
| 44 unexpected_callback_ = true; | 44 unexpected_callback_ = true; |
| 45 | 45 |
| 46 info_ = info; | 46 info_ = info; |
| 47 wait_for_port_ = false; | 47 wait_for_port_ = false; |
| 48 } | 48 } |
| 49 void SetInputPortState(uint32 port_index, MidiPortState state) override {} | 49 void SetInputPortState(uint32_t port_index, MidiPortState state) override {} |
| 50 void SetOutputPortState(uint32 port_index, MidiPortState state) override {} | 50 void SetOutputPortState(uint32_t port_index, MidiPortState state) override {} |
| 51 | 51 |
| 52 void CompleteStartSession(Result result) override { | 52 void CompleteStartSession(Result result) override { |
| 53 base::AutoLock lock(lock_); | 53 base::AutoLock lock(lock_); |
| 54 if (!wait_for_result_) | 54 if (!wait_for_result_) |
| 55 unexpected_callback_ = true; | 55 unexpected_callback_ = true; |
| 56 | 56 |
| 57 result_ = result; | 57 result_ = result; |
| 58 wait_for_result_ = false; | 58 wait_for_result_ = false; |
| 59 } | 59 } |
| 60 | 60 |
| 61 void ReceiveMidiData(uint32 port_index, const uint8* data, size_t size, | 61 void ReceiveMidiData(uint32_t port_index, |
| 62 const uint8_t* data, |
| 63 size_t size, |
| 62 double timestamp) override {} | 64 double timestamp) override {} |
| 63 void AccumulateMidiBytesSent(size_t size) override {} | 65 void AccumulateMidiBytesSent(size_t size) override {} |
| 64 void Detach() override {} | 66 void Detach() override {} |
| 65 | 67 |
| 66 bool GetWaitForResult() { | 68 bool GetWaitForResult() { |
| 67 base::AutoLock lock(lock_); | 69 base::AutoLock lock(lock_); |
| 68 return wait_for_result_; | 70 return wait_for_result_; |
| 69 } | 71 } |
| 70 | 72 |
| 71 bool GetWaitForPort() { | 73 bool GetWaitForPort() { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 if (ep) | 161 if (ep) |
| 160 MIDIEndpointDispose(ep); | 162 MIDIEndpointDispose(ep); |
| 161 if (midi_client) | 163 if (midi_client) |
| 162 MIDIClientDispose(midi_client); | 164 MIDIClientDispose(midi_client); |
| 163 } | 165 } |
| 164 | 166 |
| 165 } // namespace | 167 } // namespace |
| 166 | 168 |
| 167 } // namespace midi | 169 } // namespace midi |
| 168 } // namespace media | 170 } // namespace media |
| OLD | NEW |