Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: trunk/src/chromeos/audio/cras_audio_handler.cc

Issue 170843009: Revert 251959 "Refactor the TrayAudio code so that it can be use..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/chromeos/audio/cras_audio_handler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return input_mute_on_; 123 return input_mute_on_;
124 } 124 }
125 125
126 bool CrasAudioHandler::IsInputMutedForDevice(uint64 device_id) { 126 bool CrasAudioHandler::IsInputMutedForDevice(uint64 device_id) {
127 const AudioDevice* device = GetDeviceFromId(device_id); 127 const AudioDevice* device = GetDeviceFromId(device_id);
128 if (!device) 128 if (!device)
129 return false; 129 return false;
130 return audio_pref_handler_->GetMuteValue(*device); 130 return audio_pref_handler_->GetMuteValue(*device);
131 } 131 }
132 132
133 int CrasAudioHandler::GetOutputDefaultVolumeMuteThreshold() {
134 return kMuteThresholdPercent;
135 }
136
137 int CrasAudioHandler::GetOutputVolumePercent() { 133 int CrasAudioHandler::GetOutputVolumePercent() {
138 return output_volume_; 134 return output_volume_;
139 } 135 }
140 136
141 int CrasAudioHandler::GetOutputVolumePercentForDevice(uint64 device_id) { 137 int CrasAudioHandler::GetOutputVolumePercentForDevice(uint64 device_id) {
142 if (device_id == active_output_node_id_) { 138 if (device_id == active_output_node_id_) {
143 return output_volume_; 139 return output_volume_;
144 } else { 140 } else {
145 const AudioDevice* device = GetDeviceFromId(device_id); 141 const AudioDevice* device = GetDeviceFromId(device_id);
146 return static_cast<int>(audio_pref_handler_->GetOutputVolumeValue(device)); 142 return static_cast<int>(audio_pref_handler_->GetOutputVolumeValue(device));
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 UpdateDevicesAndSwitchActive(node_list); 689 UpdateDevicesAndSwitchActive(node_list);
694 FOR_EACH_OBSERVER(AudioObserver, observers_, OnAudioNodesChanged()); 690 FOR_EACH_OBSERVER(AudioObserver, observers_, OnAudioNodesChanged());
695 } 691 }
696 692
697 void CrasAudioHandler::HandleGetNodesError(const std::string& error_name, 693 void CrasAudioHandler::HandleGetNodesError(const std::string& error_name,
698 const std::string& error_msg) { 694 const std::string& error_msg) {
699 LOG_IF(ERROR, log_errors_) << "Failed to call GetNodes: " 695 LOG_IF(ERROR, log_errors_) << "Failed to call GetNodes: "
700 << error_name << ": " << error_msg; 696 << error_name << ": " << error_msg;
701 } 697 }
702 } // namespace chromeos 698 } // namespace chromeos
OLDNEW
« no previous file with comments | « trunk/src/chromeos/audio/cras_audio_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698