| 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 #include "chromeos/audio/cras_audio_handler.h" | 5 #include "chromeos/audio/cras_audio_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 bool CrasAudioHandler::IsOutputMutedForDevice(uint64 device_id) { | 111 bool CrasAudioHandler::IsOutputMutedForDevice(uint64 device_id) { |
| 112 const AudioDevice* device = GetDeviceFromId(device_id); | 112 const AudioDevice* device = GetDeviceFromId(device_id); |
| 113 if (!device) | 113 if (!device) |
| 114 return false; | 114 return false; |
| 115 DCHECK(!device->is_input); | 115 DCHECK(!device->is_input); |
| 116 return audio_pref_handler_->GetMuteValue(*device); | 116 return audio_pref_handler_->GetMuteValue(*device); |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool CrasAudioHandler::IsOutputVolumeBelowDefaultMuteLvel() { | 119 bool CrasAudioHandler::IsOutputVolumeBelowDefaultMuteLevel() { |
| 120 return output_volume_ <= kMuteThresholdPercent; | 120 return output_volume_ <= kMuteThresholdPercent; |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool CrasAudioHandler::IsInputMuted() { | 123 bool CrasAudioHandler::IsInputMuted() { |
| 124 return input_mute_on_; | 124 return input_mute_on_; |
| 125 } | 125 } |
| 126 | 126 |
| 127 bool CrasAudioHandler::IsInputMutedForDevice(uint64 device_id) { | 127 bool CrasAudioHandler::IsInputMutedForDevice(uint64 device_id) { |
| 128 const AudioDevice* device = GetDeviceFromId(device_id); | 128 const AudioDevice* device = GetDeviceFromId(device_id); |
| 129 if (!device) | 129 if (!device) |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 UpdateDevicesAndSwitchActive(node_list); | 704 UpdateDevicesAndSwitchActive(node_list); |
| 705 FOR_EACH_OBSERVER(AudioObserver, observers_, OnAudioNodesChanged()); | 705 FOR_EACH_OBSERVER(AudioObserver, observers_, OnAudioNodesChanged()); |
| 706 } | 706 } |
| 707 | 707 |
| 708 void CrasAudioHandler::HandleGetNodesError(const std::string& error_name, | 708 void CrasAudioHandler::HandleGetNodesError(const std::string& error_name, |
| 709 const std::string& error_msg) { | 709 const std::string& error_msg) { |
| 710 LOG_IF(ERROR, log_errors_) << "Failed to call GetNodes: " | 710 LOG_IF(ERROR, log_errors_) << "Failed to call GetNodes: " |
| 711 << error_name << ": " << error_msg; | 711 << error_name << ": " << error_msg; |
| 712 } | 712 } |
| 713 } // namespace chromeos | 713 } // namespace chromeos |
| OLD | NEW |