OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "media/midi/midi_manager.h" |
| 6 |
| 7 namespace media { |
| 8 |
| 9 MIDIManager::MIDIManager() {} |
| 10 MIDIManager::~MIDIManager() {} |
| 11 |
| 12 void MIDIManager::AddClient(Client* client) { |
| 13 base::AutoLock auto_lock(clients_lock_); |
| 14 clients_.insert(client); |
| 15 }; |
| 16 |
| 17 void MIDIManager::RemoveClient(Client* client) { |
| 18 base::AutoLock auto_lock(clients_lock_); |
| 19 ClientList::iterator i = clients_.find(client); |
| 20 clients_.erase(i); |
| 21 }; |
| 22 |
| 23 void MIDIManager::ReceiveMIDIData( |
| 24 int port_index, |
| 25 const uint8* data, |
| 26 size_t length, |
| 27 double time_stamp) { |
| 28 base::AutoLock auto_lock(clients_lock_); |
| 29 for (ClientList::iterator i = clients_.begin(); i != clients_.end(); ++i) |
| 30 (*i)->ReceiveMIDIData(port_index, data, length, time_stamp); |
| 31 }; |
| 32 |
| 33 } // namespace media |
OLD | NEW |