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

Side by Side Diff: chromeos/dbus/cras_audio_client.cc

Issue 1839943003: dbus changes: add SetGlobalOutputChannelRemix support (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
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/dbus/cras_audio_client.h" 5 #include "chromeos/dbus/cras_audio_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 dbus::MethodCall method_call(cras::kCrasControlInterface, 179 dbus::MethodCall method_call(cras::kCrasControlInterface,
180 cras::kSwapLeftRight); 180 cras::kSwapLeftRight);
181 dbus::MessageWriter writer(&method_call); 181 dbus::MessageWriter writer(&method_call);
182 writer.AppendUint64(node_id); 182 writer.AppendUint64(node_id);
183 writer.AppendBool(swap); 183 writer.AppendBool(swap);
184 cras_proxy_->CallMethod(&method_call, 184 cras_proxy_->CallMethod(&method_call,
185 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 185 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
186 dbus::ObjectProxy::EmptyResponseCallback()); 186 dbus::ObjectProxy::EmptyResponseCallback());
187 } 187 }
188 188
189 void SetGlobalOutputChannelRemix(int32_t channels,
190 const std::vector<double>& mixer) override {
191 dbus::MethodCall method_call(cras::kCrasControlInterface,
192 cras::kSetGlobalOutputChannelRemix);
193 dbus::MessageWriter writer(&method_call);
194 writer.AppendInt32(channels);
195 writer.AppendArrayOfDoubles(mixer.data(), mixer.size());
196 cras_proxy_->CallMethod(&method_call,
197 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
198 dbus::ObjectProxy::EmptyResponseCallback());
199 }
200
189 void WaitForServiceToBeAvailable( 201 void WaitForServiceToBeAvailable(
190 const WaitForServiceToBeAvailableCallback& callback) override { 202 const WaitForServiceToBeAvailableCallback& callback) override {
191 cras_proxy_->WaitForServiceToBeAvailable(callback); 203 cras_proxy_->WaitForServiceToBeAvailable(callback);
192 } 204 }
193 205
194 protected: 206 protected:
195 void Init(dbus::Bus* bus) override { 207 void Init(dbus::Bus* bus) override {
196 cras_proxy_ = bus->GetObjectProxy(cras::kCrasServiceName, 208 cras_proxy_ = bus->GetObjectProxy(cras::kCrasServiceName,
197 dbus::ObjectPath(cras::kCrasServicePath)); 209 dbus::ObjectPath(cras::kCrasServicePath));
198 210
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 474
463 CrasAudioClient::~CrasAudioClient() { 475 CrasAudioClient::~CrasAudioClient() {
464 } 476 }
465 477
466 // static 478 // static
467 CrasAudioClient* CrasAudioClient::Create() { 479 CrasAudioClient* CrasAudioClient::Create() {
468 return new CrasAudioClientImpl(); 480 return new CrasAudioClientImpl();
469 } 481 }
470 482
471 } // namespace chromeos 483 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698