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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // |new_active_device|. | 223 // |new_active_device|. |
224 bool ChangeActiveDevice(const AudioDevice& new_active_device, | 224 bool ChangeActiveDevice(const AudioDevice& new_active_device, |
225 uint64* current_active_node_id); | 225 uint64* current_active_node_id); |
226 | 226 |
227 // Returns true if the audio nodes change is caused by some non-active | 227 // Returns true if the audio nodes change is caused by some non-active |
228 // audio nodes unplugged. | 228 // audio nodes unplugged. |
229 bool NonActiveDeviceUnplugged(size_t old_devices_size, | 229 bool NonActiveDeviceUnplugged(size_t old_devices_size, |
230 size_t new_device_size, | 230 size_t new_device_size, |
231 uint64 current_active_node); | 231 uint64 current_active_node); |
232 | 232 |
| 233 // Returns true if there is any device change for for input or output, |
| 234 // specified by |is_input|. |
| 235 bool HasDeviceChange(const AudioNodeList& new_nodes, bool is_input); |
| 236 |
233 // Handles dbus callback for GetNodes. | 237 // Handles dbus callback for GetNodes. |
234 void HandleGetNodes(const chromeos::AudioNodeList& node_list, bool success); | 238 void HandleGetNodes(const chromeos::AudioNodeList& node_list, bool success); |
235 | 239 |
236 scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler_; | 240 scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler_; |
237 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; | 241 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; |
238 ObserverList<AudioObserver> observers_; | 242 ObserverList<AudioObserver> observers_; |
239 | 243 |
240 // Audio data and state. | 244 // Audio data and state. |
241 AudioDeviceMap audio_devices_; | 245 AudioDeviceMap audio_devices_; |
242 | 246 |
(...skipping 11 matching lines...) Expand all Loading... |
254 | 258 |
255 bool output_mute_locked_; | 259 bool output_mute_locked_; |
256 bool input_mute_locked_; | 260 bool input_mute_locked_; |
257 | 261 |
258 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); | 262 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); |
259 }; | 263 }; |
260 | 264 |
261 } // namespace chromeos | 265 } // namespace chromeos |
262 | 266 |
263 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 267 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
OLD | NEW |