OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 "chromeos/dbus/fake_cras_audio_client.h" | 5 #include "chromeos/dbus/fake_cras_audio_client.h" |
6 | 6 |
7 namespace chromeos { | 7 namespace chromeos { |
8 | 8 |
9 FakeCrasAudioClient::FakeCrasAudioClient() | 9 FakeCrasAudioClient::FakeCrasAudioClient() |
10 : active_input_node_id_(0), | 10 : active_input_node_id_(0), |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 void FakeCrasAudioClient::SwapLeftRight(uint64_t node_id, bool swap) {} | 168 void FakeCrasAudioClient::SwapLeftRight(uint64_t node_id, bool swap) {} |
169 | 169 |
170 void FakeCrasAudioClient::AddActiveOutputNode(uint64_t node_id) { | 170 void FakeCrasAudioClient::AddActiveOutputNode(uint64_t node_id) { |
171 for (size_t i = 0; i < node_list_.size(); ++i) { | 171 for (size_t i = 0; i < node_list_.size(); ++i) { |
172 if (node_list_[i].id == node_id) | 172 if (node_list_[i].id == node_id) |
173 node_list_[i].active = true; | 173 node_list_[i].active = true; |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
| 177 void FakeCrasAudioClient::WaitForServiceToBeAvailable( |
| 178 const WaitForServiceToBeAvailableCallback& callback) { |
| 179 callback.Run(true); |
| 180 } |
| 181 |
177 void FakeCrasAudioClient::RemoveActiveOutputNode(uint64_t node_id) { | 182 void FakeCrasAudioClient::RemoveActiveOutputNode(uint64_t node_id) { |
178 for (size_t i = 0; i < node_list_.size(); ++i) { | 183 for (size_t i = 0; i < node_list_.size(); ++i) { |
179 if (node_list_[i].id == node_id) | 184 if (node_list_[i].id == node_id) |
180 node_list_[i].active = false; | 185 node_list_[i].active = false; |
181 } | 186 } |
182 } | 187 } |
183 | 188 |
184 void FakeCrasAudioClient::InsertAudioNodeToList(const AudioNode& audio_node) { | 189 void FakeCrasAudioClient::InsertAudioNodeToList(const AudioNode& audio_node) { |
185 auto iter = FindNode(audio_node.id); | 190 auto iter = FindNode(audio_node.id); |
186 if (iter != node_list_.end()) | 191 if (iter != node_list_.end()) |
(...skipping 22 matching lines...) Expand all Loading... |
209 FOR_EACH_OBSERVER(Observer, observers_, NodesChanged()); | 214 FOR_EACH_OBSERVER(Observer, observers_, NodesChanged()); |
210 } | 215 } |
211 | 216 |
212 AudioNodeList::iterator FakeCrasAudioClient::FindNode(uint64_t node_id) { | 217 AudioNodeList::iterator FakeCrasAudioClient::FindNode(uint64_t node_id) { |
213 return std::find_if( | 218 return std::find_if( |
214 node_list_.begin(), node_list_.end(), | 219 node_list_.begin(), node_list_.end(), |
215 [node_id](const AudioNode& node) { return node_id == node.id; }); | 220 [node_id](const AudioNode& node) { return node_id == node.id; }); |
216 } | 221 } |
217 | 222 |
218 } // namespace chromeos | 223 } // namespace chromeos |
OLD | NEW |