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

Side by Side Diff: chromeos/audio/audio_a11y_controller.cc

Issue 1840913002: A11y setting: mono audio UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chromeos/audio/audio_a11y_controller.h"
6
7 #include <vector>
8
9 #include "chromeos/dbus/cras_audio_client.h"
10 #include "chromeos/dbus/dbus_thread_manager.h"
11
12 namespace chromeos {
13 namespace {
14 static const std::vector<double> kStereoToMono = {0.5, 0.5, 0.5, 0.5};
15 static const std::vector<double> kStereoToStereo = {1, 0, 0, 1};
16 } // namespace
17
18 AudioA11yController::AudioA11yController() {}
19
20 AudioA11yController::~AudioA11yController() {}
21
22 void AudioA11yController::SetOutputMono(bool enabled) {
23 if (output_mono_enabled_ == enabled)
24 return;
25 output_mono_enabled_ = enabled;
26
27 if (output_mono_enabled_) {
28 chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
29 SetGlobalOutputChannelRemix(channels_, kStereoToMono);
30 } else {
31 chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
32 SetGlobalOutputChannelRemix(channels_, kStereoToStereo);
33 }
34 }
35
36 bool AudioA11yController::IsOutputMonoEnabled() const {
37 return output_mono_enabled_;
38 }
39
40 } // namespace chromeos
41
42
43
44
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698