| Index: chromeos/audio/audio_a11y_controller.cc
|
| diff --git a/chromeos/audio/audio_a11y_controller.cc b/chromeos/audio/audio_a11y_controller.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..01427cd6f5e285e96ee9092028d866ccdb5618ee
|
| --- /dev/null
|
| +++ b/chromeos/audio/audio_a11y_controller.cc
|
| @@ -0,0 +1,44 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chromeos/audio/audio_a11y_controller.h"
|
| +
|
| +#include <vector>
|
| +
|
| +#include "chromeos/dbus/cras_audio_client.h"
|
| +#include "chromeos/dbus/dbus_thread_manager.h"
|
| +
|
| +namespace chromeos {
|
| +namespace {
|
| +static const std::vector<double> kStereoToMono = {0.5, 0.5, 0.5, 0.5};
|
| +static const std::vector<double> kStereoToStereo = {1, 0, 0, 1};
|
| +} // namespace
|
| +
|
| +AudioA11yController::AudioA11yController() {}
|
| +
|
| +AudioA11yController::~AudioA11yController() {}
|
| +
|
| +void AudioA11yController::SetOutputMono(bool enabled) {
|
| + if (output_mono_enabled_ == enabled)
|
| + return;
|
| + output_mono_enabled_ = enabled;
|
| +
|
| + if (output_mono_enabled_) {
|
| + chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
|
| + SetGlobalOutputChannelRemix(channels_, kStereoToMono);
|
| + } else {
|
| + chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
|
| + SetGlobalOutputChannelRemix(channels_, kStereoToStereo);
|
| + }
|
| +}
|
| +
|
| +bool AudioA11yController::IsOutputMonoEnabled() const {
|
| + return output_mono_enabled_;
|
| +}
|
| +
|
| +} // namespace chromeos
|
| +
|
| +
|
| +
|
| +
|
|
|