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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 | 59 |
60 // Called when audio nodes changed. | 60 // Called when audio nodes changed. |
61 virtual void OnAudioNodesChanged(); | 61 virtual void OnAudioNodesChanged(); |
62 | 62 |
63 // Called when active audio node changed. | 63 // Called when active audio node changed. |
64 virtual void OnActiveOutputNodeChanged(); | 64 virtual void OnActiveOutputNodeChanged(); |
65 | 65 |
66 // Called when active audio input node changed. | 66 // Called when active audio input node changed. |
67 virtual void OnActiveInputNodeChanged(); | 67 virtual void OnActiveInputNodeChanged(); |
68 | 68 |
69 // Called when output channel remixing changed. | |
70 virtual void OnOuputChannelRemixingChanged(bool mono_on); | |
71 | |
69 protected: | 72 protected: |
70 AudioObserver(); | 73 AudioObserver(); |
71 virtual ~AudioObserver(); | 74 virtual ~AudioObserver(); |
72 DISALLOW_COPY_AND_ASSIGN(AudioObserver); | 75 DISALLOW_COPY_AND_ASSIGN(AudioObserver); |
73 }; | 76 }; |
74 | 77 |
75 enum DeviceActivateType { | 78 enum DeviceActivateType { |
76 ACTIVATE_BY_PRIORITY = 0, | 79 ACTIVATE_BY_PRIORITY = 0, |
77 ACTIVATE_BY_USER, | 80 ACTIVATE_BY_USER, |
78 ACTIVATE_BY_RESTORE_PREVIOUS_STATE, | 81 ACTIVATE_BY_RESTORE_PREVIOUS_STATE, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 // remain active. Otherwise, the old active nodes will be de-activated before | 202 // remain active. Otherwise, the old active nodes will be de-activated before |
200 // we activate the new nodes with the same type(input/output). | 203 // we activate the new nodes with the same type(input/output). |
201 virtual void ChangeActiveNodes(const NodeIdList& new_active_ids); | 204 virtual void ChangeActiveNodes(const NodeIdList& new_active_ids); |
202 | 205 |
203 // Swaps the left and right channel of the internal speaker. | 206 // Swaps the left and right channel of the internal speaker. |
204 // Swap the left and right channel if |swap| is true; otherwise, swap the left | 207 // Swap the left and right channel if |swap| is true; otherwise, swap the left |
205 // and right channel back to the normal mode. | 208 // and right channel back to the normal mode. |
206 // If the feature is not supported on the device, nothing happens. | 209 // If the feature is not supported on the device, nothing happens. |
207 virtual void SwapInternalSpeakerLeftRightChannel(bool swap); | 210 virtual void SwapInternalSpeakerLeftRightChannel(bool swap); |
208 | 211 |
212 // Accessibility audio setting: sets the output mono or not. | |
213 virtual void SetOutputMono(bool mono_on); | |
214 | |
215 // Returns true if output mono is enabled. | |
216 virtual bool IsOutputMonoEnabled() const; | |
217 | |
209 // Enables error logging. | 218 // Enables error logging. |
210 virtual void LogErrors(); | 219 virtual void LogErrors(); |
211 | 220 |
212 // If necessary, sets the starting point for re-discovering the active HDMI | 221 // If necessary, sets the starting point for re-discovering the active HDMI |
213 // output device caused by device entering/exiting docking mode, HDMI display | 222 // output device caused by device entering/exiting docking mode, HDMI display |
214 // changing resolution, or chromeos device suspend/resume. If | 223 // changing resolution, or chromeos device suspend/resume. If |
215 // |force_rediscovering| is true, it will force to set the starting point for | 224 // |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 | 225 // re-discovering the active HDMI output device again if it has been in the |
217 // middle of rediscovering the HDMI active output device. | 226 // middle of rediscovering the HDMI active output device. |
218 virtual void SetActiveHDMIOutoutRediscoveringIfNecessary( | 227 virtual void SetActiveHDMIOutoutRediscoveringIfNecessary( |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
401 bool input_mute_on_; | 410 bool input_mute_on_; |
402 int output_volume_; | 411 int output_volume_; |
403 int input_gain_; | 412 int input_gain_; |
404 uint64_t active_output_node_id_; | 413 uint64_t active_output_node_id_; |
405 uint64_t active_input_node_id_; | 414 uint64_t active_input_node_id_; |
406 bool has_alternative_input_; | 415 bool has_alternative_input_; |
407 bool has_alternative_output_; | 416 bool has_alternative_output_; |
408 | 417 |
409 bool output_mute_locked_; | 418 bool output_mute_locked_; |
410 | 419 |
420 // Audio output channel counts. | |
421 int32_t channels_; | |
jennyz
2016/03/30 23:39:26
How about naming it output_channels_?
| |
422 bool output_mono_on_; | |
423 | |
411 // Failures are not logged at startup, since CRAS may not be running yet. | 424 // Failures are not logged at startup, since CRAS may not be running yet. |
412 bool log_errors_; | 425 bool log_errors_; |
413 | 426 |
414 // Timer for HDMI re-discovering grace period. | 427 // Timer for HDMI re-discovering grace period. |
415 base::OneShotTimer hdmi_rediscover_timer_; | 428 base::OneShotTimer hdmi_rediscover_timer_; |
416 int hdmi_rediscover_grace_period_duration_in_ms_; | 429 int hdmi_rediscover_grace_period_duration_in_ms_; |
417 bool hdmi_rediscovering_; | 430 bool hdmi_rediscovering_; |
418 | 431 |
419 bool cras_service_available_ = false; | 432 bool cras_service_available_ = false; |
420 | 433 |
421 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; | 434 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; |
422 | 435 |
423 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); | 436 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); |
424 }; | 437 }; |
425 | 438 |
426 } // namespace chromeos | 439 } // namespace chromeos |
427 | 440 |
428 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 441 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
OLD | NEW |