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

Side by Side Diff: extensions/browser/api/audio/audio_service.cc

Issue 2578473002: chrome.audio API: treat mute as system wide property (Closed)
Patch Set: . Created 4 years 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 "extensions/browser/api/audio/audio_service.h" 5 #include "extensions/browser/api/audio/audio_service.h"
6 6
7 namespace extensions { 7 namespace extensions {
8 8
9 class AudioServiceImpl : public AudioService { 9 class AudioServiceImpl : public AudioService {
10 public: 10 public:
11 AudioServiceImpl() {} 11 AudioServiceImpl() {}
12 ~AudioServiceImpl() override {} 12 ~AudioServiceImpl() override {}
13 13
14 // Called by listeners to this service to add/remove themselves as observers. 14 // Called by listeners to this service to add/remove themselves as observers.
15 void AddObserver(Observer* observer) override; 15 void AddObserver(Observer* observer) override;
16 void RemoveObserver(Observer* observer) override; 16 void RemoveObserver(Observer* observer) override;
17 17
18 // Start to query audio device information. 18 // Start to query audio device information.
19 bool GetInfo(OutputInfo* output_info_out, InputInfo* input_info_out) override; 19 bool GetInfo(OutputInfo* output_info_out, InputInfo* input_info_out) override;
20 void SetActiveDevices(const DeviceIdList& device_list) override; 20 void SetActiveDevices(const DeviceIdList& device_list) override;
21 bool SetDeviceProperties(const std::string& device_id, 21 bool SetDeviceSoundLevel(const std::string& device_id,
22 bool muted,
23 int volume, 22 int volume,
24 int gain) override; 23 int gain) override;
24 bool SetMuteForDevice(const std::string& device_id, bool value) override;
25 bool SetMute(bool is_input, bool value) override;
26 bool GetMute(bool is_input, bool* value) override;
25 }; 27 };
26 28
27 void AudioServiceImpl::AddObserver(Observer* observer) { 29 void AudioServiceImpl::AddObserver(Observer* observer) {
28 // TODO: implement this for platforms other than Chrome OS. 30 // TODO: implement this for platforms other than Chrome OS.
29 } 31 }
30 32
31 void AudioServiceImpl::RemoveObserver(Observer* observer) { 33 void AudioServiceImpl::RemoveObserver(Observer* observer) {
32 // TODO: implement this for platforms other than Chrome OS. 34 // TODO: implement this for platforms other than Chrome OS.
33 } 35 }
34 36
35 AudioService* AudioService::CreateInstance() { 37 AudioService* AudioService::CreateInstance() {
36 return new AudioServiceImpl; 38 return new AudioServiceImpl;
37 } 39 }
38 40
39 bool AudioServiceImpl::GetInfo(OutputInfo* output_info_out, 41 bool AudioServiceImpl::GetInfo(OutputInfo* output_info_out,
40 InputInfo* input_info_out) { 42 InputInfo* input_info_out) {
41 // TODO: implement this for platforms other than Chrome OS. 43 // TODO: implement this for platforms other than Chrome OS.
42 return false; 44 return false;
43 } 45 }
44 46
45 void AudioServiceImpl::SetActiveDevices(const DeviceIdList& device_list) { 47 void AudioServiceImpl::SetActiveDevices(const DeviceIdList& device_list) {
46 } 48 }
47 49
48 bool AudioServiceImpl::SetDeviceProperties(const std::string& device_id, 50 bool AudioServiceImpl::SetDeviceSoundLevel(const std::string& device_id,
49 bool muted,
50 int volume, 51 int volume,
51 int gain) { 52 int gain) {
52 return false; 53 return false;
53 } 54 }
54 55
56 bool AudioServiceImpl::SetMuteForDevice(const std::string& device_id,
57 bool value) {
58 return false;
59 }
60
61 bool AudioServiceImpl::SetMute(bool is_input, bool value) {
62 return false;
63 }
64
65 bool AudioServiceImpl::GetMute(bool is_input, bool* value) {
66 return false;
67 }
68
55 } // namespace extensions 69 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698