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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <queue> | 10 #include <queue> |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 // If necessary, sets the starting point for re-discovering the active HDMI | 212 // If necessary, sets the starting point for re-discovering the active HDMI |
213 // output device caused by device entering/exiting docking mode, HDMI display | 213 // output device caused by device entering/exiting docking mode, HDMI display |
214 // changing resolution, or chromeos device suspend/resume. If | 214 // changing resolution, or chromeos device suspend/resume. If |
215 // |force_rediscovering| is true, it will force to set the starting point for | 215 // |force_rediscovering| is true, it will force to set the starting point for |
216 // re-discovering the active HDMI output device again if it has been in the | 216 // re-discovering the active HDMI output device again if it has been in the |
217 // middle of rediscovering the HDMI active output device. | 217 // middle of rediscovering the HDMI active output device. |
218 virtual void SetActiveHDMIOutoutRediscoveringIfNecessary( | 218 virtual void SetActiveHDMIOutoutRediscoveringIfNecessary( |
219 bool force_rediscovering); | 219 bool force_rediscovering); |
220 | 220 |
| 221 virtual const AudioDevice* GetDeviceFromId(uint64_t device_id) const; |
| 222 |
221 protected: | 223 protected: |
222 explicit CrasAudioHandler( | 224 explicit CrasAudioHandler( |
223 scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler); | 225 scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler); |
224 ~CrasAudioHandler() override; | 226 ~CrasAudioHandler() override; |
225 | 227 |
226 private: | 228 private: |
227 friend class CrasAudioHandlerTest; | 229 friend class CrasAudioHandlerTest; |
228 | 230 |
229 // CrasAudioClient::Observer overrides. | 231 // CrasAudioClient::Observer overrides. |
230 void AudioClientRestarted() override; | 232 void AudioClientRestarted() override; |
(...skipping 22 matching lines...) Expand all Loading... |
253 DeviceActivateType activate_by); | 255 DeviceActivateType activate_by); |
254 | 256 |
255 // Sets up the audio device state based on audio policy and audio settings | 257 // Sets up the audio device state based on audio policy and audio settings |
256 // saved in prefs. | 258 // saved in prefs. |
257 void SetupAudioInputState(); | 259 void SetupAudioInputState(); |
258 void SetupAudioOutputState(); | 260 void SetupAudioOutputState(); |
259 | 261 |
260 // Sets up the additional active audio node's state. | 262 // Sets up the additional active audio node's state. |
261 void SetupAdditionalActiveAudioNodeState(uint64_t node_id); | 263 void SetupAdditionalActiveAudioNodeState(uint64_t node_id); |
262 | 264 |
263 const AudioDevice* GetDeviceFromId(uint64_t device_id) const; | |
264 const AudioDevice* GetDeviceFromStableDeviceId( | 265 const AudioDevice* GetDeviceFromStableDeviceId( |
265 uint64_t stable_device_id) const; | 266 uint64_t stable_device_id) const; |
266 const AudioDevice* GetKeyboardMic() const; | 267 const AudioDevice* GetKeyboardMic() const; |
267 | 268 |
268 // Initializes audio state, which should only be called when CrasAudioHandler | 269 // Initializes audio state, which should only be called when CrasAudioHandler |
269 // is created or cras audio client is restarted. | 270 // is created or cras audio client is restarted. |
270 void InitializeAudioState(); | 271 void InitializeAudioState(); |
271 | 272 |
272 void InitializeAudioAfterCrasServiceAvailable(bool service_is_available); | 273 void InitializeAudioAfterCrasServiceAvailable(bool service_is_available); |
273 | 274 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 bool cras_service_available_ = false; | 419 bool cras_service_available_ = false; |
419 | 420 |
420 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; | 421 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; |
421 | 422 |
422 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); | 423 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); |
423 }; | 424 }; |
424 | 425 |
425 } // namespace chromeos | 426 } // namespace chromeos |
426 | 427 |
427 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 428 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
OLD | NEW |