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