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 #ifndef CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 5 #ifndef CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
6 #define CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 6 #define CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // specified by |is_input|. | 231 // specified by |is_input|. |
232 bool HasDeviceChange(const AudioNodeList& new_nodes, bool is_input); | 232 bool HasDeviceChange(const AudioNodeList& new_nodes, bool is_input); |
233 | 233 |
234 // Handles dbus callback for GetNodes. | 234 // Handles dbus callback for GetNodes. |
235 void HandleGetNodes(const chromeos::AudioNodeList& node_list, bool success); | 235 void HandleGetNodes(const chromeos::AudioNodeList& node_list, bool success); |
236 | 236 |
237 // Handles the dbus error callback. | 237 // Handles the dbus error callback. |
238 void HandleGetNodesError(const std::string& error_name, | 238 void HandleGetNodesError(const std::string& error_name, |
239 const std::string& error_msg); | 239 const std::string& error_msg); |
240 | 240 |
| 241 // Returns true if |device| is not found in audio_devices_. |
| 242 bool FoundNewDevice(const AudioDevice& device); |
| 243 |
241 scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler_; | 244 scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler_; |
242 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; | 245 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; |
243 ObserverList<AudioObserver> observers_; | 246 ObserverList<AudioObserver> observers_; |
244 | 247 |
245 // Audio data and state. | 248 // Audio data and state. |
246 AudioDeviceMap audio_devices_; | 249 AudioDeviceMap audio_devices_; |
247 | 250 |
248 AudioDevicePriorityQueue input_devices_pq_; | 251 AudioDevicePriorityQueue input_devices_pq_; |
249 AudioDevicePriorityQueue output_devices_pq_; | 252 AudioDevicePriorityQueue output_devices_pq_; |
250 | 253 |
(...skipping 11 matching lines...) Expand all Loading... |
262 | 265 |
263 // Failures are not logged at startup, since CRAS may not be running yet. | 266 // Failures are not logged at startup, since CRAS may not be running yet. |
264 bool log_errors_; | 267 bool log_errors_; |
265 | 268 |
266 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); | 269 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); |
267 }; | 270 }; |
268 | 271 |
269 } // namespace chromeos | 272 } // namespace chromeos |
270 | 273 |
271 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 274 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
OLD | NEW |