| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "chromeos/audio/audio_device.h" | 14 #include "chromeos/audio/audio_device.h" |
| 15 #include "chromeos/audio/audio_pref_observer.h" | 15 #include "chromeos/audio/audio_pref_observer.h" |
| 16 #include "chromeos/dbus/audio_node.h" | 16 #include "chromeos/dbus/audio_node.h" |
| 17 #include "chromeos/dbus/cras_audio_client.h" | 17 #include "chromeos/dbus/cras_audio_client.h" |
| 18 #include "chromeos/dbus/session_manager_client.h" | 18 #include "chromeos/dbus/session_manager_client.h" |
| 19 #include "chromeos/dbus/volume_state.h" | 19 #include "chromeos/dbus/volume_state.h" |
| 20 #include "media/audio/audio_manager.h" |
| 20 | 21 |
| 21 class PrefRegistrySimple; | 22 class PrefRegistrySimple; |
| 22 class PrefService; | 23 class PrefService; |
| 23 | 24 |
| 24 namespace chromeos { | 25 namespace chromeos { |
| 25 | 26 |
| 26 class AudioDevicesPrefHandler; | 27 class AudioDevicesPrefHandler; |
| 27 | 28 |
| 28 class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer, | 29 class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer, |
| 29 public AudioPrefObserver, | 30 public AudioPrefObserver, |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 bool is_input, | 275 bool is_input, |
| 275 AudioNodeList* new_discovered); | 276 AudioNodeList* new_discovered); |
| 276 | 277 |
| 277 // Handles dbus callback for GetNodes. | 278 // Handles dbus callback for GetNodes. |
| 278 void HandleGetNodes(const chromeos::AudioNodeList& node_list, bool success); | 279 void HandleGetNodes(const chromeos::AudioNodeList& node_list, bool success); |
| 279 | 280 |
| 280 // Handles the dbus error callback. | 281 // Handles the dbus error callback. |
| 281 void HandleGetNodesError(const std::string& error_name, | 282 void HandleGetNodesError(const std::string& error_name, |
| 282 const std::string& error_msg); | 283 const std::string& error_msg); |
| 283 | 284 |
| 285 // Sets HasInputDevice in CrasAudioManager. |
| 286 void UpdateAudioManagerHasInputDevices(); |
| 287 |
| 284 // Adds an active node. | 288 // Adds an active node. |
| 285 // If there is no active node, |node_id| will be switched to become the | 289 // If there is no active node, |node_id| will be switched to become the |
| 286 // primary active node. Otherwise, it will be added as an additional active | 290 // primary active node. Otherwise, it will be added as an additional active |
| 287 // node. | 291 // node. |
| 288 void AddActiveNode(uint64_t node_id, bool notify); | 292 void AddActiveNode(uint64_t node_id, bool notify); |
| 289 | 293 |
| 290 // Adds |node_id| into additional active nodes. | 294 // Adds |node_id| into additional active nodes. |
| 291 void AddAdditionalActiveNode(uint64_t node_id, bool notify); | 295 void AddAdditionalActiveNode(uint64_t node_id, bool notify); |
| 292 | 296 |
| 293 // Removes |node_id| from additional active nodes. | 297 // Removes |node_id| from additional active nodes. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 bool log_errors_; | 333 bool log_errors_; |
| 330 | 334 |
| 331 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; | 335 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; |
| 332 | 336 |
| 333 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); | 337 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); |
| 334 }; | 338 }; |
| 335 | 339 |
| 336 } // namespace chromeos | 340 } // namespace chromeos |
| 337 | 341 |
| 338 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 342 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
| OLD | NEW |