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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 // Sets output mute state to |mute_on| internally, returns true if output mute | 240 // Sets output mute state to |mute_on| internally, returns true if output mute |
241 // is set. | 241 // is set. |
242 bool SetOutputMuteInternal(bool mute_on); | 242 bool SetOutputMuteInternal(bool mute_on); |
243 | 243 |
244 // Sets input gain of |node_id| to |gain|. | 244 // Sets input gain of |node_id| to |gain|. |
245 void SetInputNodeGain(uint64 node_id, int gain); | 245 void SetInputNodeGain(uint64 node_id, int gain); |
246 | 246 |
247 void SetInputNodeGainPercent(uint64 node_id, int gain_percent); | 247 void SetInputNodeGainPercent(uint64 node_id, int gain_percent); |
248 | 248 |
249 // Sets input mute state to |mute_on| internally, returns true if input mute | 249 // Sets input mute state to |mute_on| internally. |
250 // is set. | 250 void SetInputMuteInternal(bool mute_on); |
251 bool SetInputMuteInternal(bool mute_on); | |
252 | 251 |
253 // Calling dbus to get nodes data. | 252 // Calling dbus to get nodes data. |
254 void GetNodes(); | 253 void GetNodes(); |
255 | 254 |
256 // Updates the current audio nodes list and switches the active device | 255 // Updates the current audio nodes list and switches the active device |
257 // if needed. | 256 // if needed. |
258 void UpdateDevicesAndSwitchActive(const AudioNodeList& nodes); | 257 void UpdateDevicesAndSwitchActive(const AudioNodeList& nodes); |
259 | 258 |
260 // Returns true if *|current_active_node_id| device is changed to | 259 // Returns true if *|current_active_node_id| device is changed to |
261 // |new_active_device|. | 260 // |new_active_device|. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 bool output_mute_on_; | 308 bool output_mute_on_; |
310 bool input_mute_on_; | 309 bool input_mute_on_; |
311 int output_volume_; | 310 int output_volume_; |
312 int input_gain_; | 311 int input_gain_; |
313 uint64 active_output_node_id_; | 312 uint64 active_output_node_id_; |
314 uint64 active_input_node_id_; | 313 uint64 active_input_node_id_; |
315 bool has_alternative_input_; | 314 bool has_alternative_input_; |
316 bool has_alternative_output_; | 315 bool has_alternative_output_; |
317 | 316 |
318 bool output_mute_locked_; | 317 bool output_mute_locked_; |
319 bool input_mute_locked_; | |
320 | 318 |
321 // Failures are not logged at startup, since CRAS may not be running yet. | 319 // Failures are not logged at startup, since CRAS may not be running yet. |
322 bool log_errors_; | 320 bool log_errors_; |
323 | 321 |
324 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; | 322 base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; |
325 | 323 |
326 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); | 324 DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); |
327 }; | 325 }; |
328 | 326 |
329 } // namespace chromeos | 327 } // namespace chromeos |
330 | 328 |
331 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ | 329 #endif // CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ |
OLD | NEW |