| 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_alsa.h" | 5 #include "media/midi/midi_manager_alsa.h" |
| 6 | 6 |
| 7 #include <poll.h> | 7 #include <poll.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 delay = std::max(time_to_send - base::TimeTicks::Now(), base::TimeDelta()); | 290 delay = std::max(time_to_send - base::TimeTicks::Now(), base::TimeDelta()); |
| 291 } | 291 } |
| 292 | 292 |
| 293 send_thread_.message_loop()->PostDelayedTask( | 293 send_thread_.message_loop()->PostDelayedTask( |
| 294 FROM_HERE, base::Bind(&MidiManagerAlsa::SendMidiData, | 294 FROM_HERE, base::Bind(&MidiManagerAlsa::SendMidiData, |
| 295 base::Unretained(this), port_index, data), | 295 base::Unretained(this), port_index, data), |
| 296 delay); | 296 delay); |
| 297 | 297 |
| 298 // Acknowledge send. | 298 // Acknowledge send. |
| 299 send_thread_.message_loop()->PostTask( | 299 send_thread_.message_loop()->PostTask( |
| 300 FROM_HERE, base::Bind(&MidiManagerClient::AccumulateMidiBytesSent, | 300 FROM_HERE, base::Bind(&MidiManagerAlsa::AccumulateMidiBytesSent, |
| 301 base::Unretained(client), data.size())); | 301 base::Unretained(this), client, data.size())); |
| 302 } | 302 } |
| 303 | 303 |
| 304 MidiManagerAlsa::MidiPort::Id::Id() = default; | 304 MidiManagerAlsa::MidiPort::Id::Id() = default; |
| 305 | 305 |
| 306 MidiManagerAlsa::MidiPort::Id::Id(const std::string& bus, | 306 MidiManagerAlsa::MidiPort::Id::Id(const std::string& bus, |
| 307 const std::string& vendor_id, | 307 const std::string& vendor_id, |
| 308 const std::string& model_id, | 308 const std::string& model_id, |
| 309 const std::string& usb_interface_num, | 309 const std::string& usb_interface_num, |
| 310 const std::string& serial) | 310 const std::string& serial) |
| 311 : bus_(bus), | 311 : bus_(bus), |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 source_map_[AddrToInt(client_id, port_id)] = port_index; | 1340 source_map_[AddrToInt(client_id, port_id)] = port_index; |
| 1341 return true; | 1341 return true; |
| 1342 } | 1342 } |
| 1343 | 1343 |
| 1344 MidiManager* MidiManager::Create() { | 1344 MidiManager* MidiManager::Create() { |
| 1345 return new MidiManagerAlsa(); | 1345 return new MidiManagerAlsa(); |
| 1346 } | 1346 } |
| 1347 | 1347 |
| 1348 } // namespace midi | 1348 } // namespace midi |
| 1349 } // namespace media | 1349 } // namespace media |
| OLD | NEW |