| OLD | NEW |
| 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 SetActiveDeviceLists( | 21 bool SetActiveDeviceLists( |
| 22 const std::unique_ptr<DeviceIdList>& input_devices, | 22 const std::unique_ptr<DeviceIdList>& input_devices, |
| 23 const std::unique_ptr<DeviceIdList>& output_devives) override; | 23 const std::unique_ptr<DeviceIdList>& output_devives) override; |
| 24 bool SetDeviceProperties(const std::string& device_id, | 24 bool SetDeviceSoundLevel(const std::string& device_id, |
| 25 bool muted, | |
| 26 int volume, | 25 int volume, |
| 27 int gain) override; | 26 int gain) override; |
| 27 bool SetMuteForDevice(const std::string& device_id, bool value) override; |
| 28 bool SetMute(bool is_input, bool value) override; |
| 29 bool GetMute(bool is_input, bool* value) override; |
| 28 }; | 30 }; |
| 29 | 31 |
| 30 void AudioServiceImpl::AddObserver(Observer* observer) { | 32 void AudioServiceImpl::AddObserver(Observer* observer) { |
| 31 // TODO: implement this for platforms other than Chrome OS. | 33 // TODO: implement this for platforms other than Chrome OS. |
| 32 } | 34 } |
| 33 | 35 |
| 34 void AudioServiceImpl::RemoveObserver(Observer* observer) { | 36 void AudioServiceImpl::RemoveObserver(Observer* observer) { |
| 35 // TODO: implement this for platforms other than Chrome OS. | 37 // TODO: implement this for platforms other than Chrome OS. |
| 36 } | 38 } |
| 37 | 39 |
| 38 AudioService* AudioService::CreateInstance() { | 40 AudioService* AudioService::CreateInstance() { |
| 39 return new AudioServiceImpl; | 41 return new AudioServiceImpl; |
| 40 } | 42 } |
| 41 | 43 |
| 42 bool AudioServiceImpl::GetInfo(OutputInfo* output_info_out, | 44 bool AudioServiceImpl::GetInfo(OutputInfo* output_info_out, |
| 43 InputInfo* input_info_out) { | 45 InputInfo* input_info_out) { |
| 44 // TODO: implement this for platforms other than Chrome OS. | 46 // TODO: implement this for platforms other than Chrome OS. |
| 45 return false; | 47 return false; |
| 46 } | 48 } |
| 47 | 49 |
| 48 bool AudioServiceImpl::SetActiveDeviceLists( | 50 bool AudioServiceImpl::SetActiveDeviceLists( |
| 49 const std::unique_ptr<DeviceIdList>& input_devices, | 51 const std::unique_ptr<DeviceIdList>& input_devices, |
| 50 const std::unique_ptr<DeviceIdList>& output_devives) { | 52 const std::unique_ptr<DeviceIdList>& output_devives) { |
| 51 return false; | 53 return false; |
| 52 } | 54 } |
| 53 | 55 |
| 54 void AudioServiceImpl::SetActiveDevices(const DeviceIdList& device_list) { | 56 void AudioServiceImpl::SetActiveDevices(const DeviceIdList& device_list) { |
| 55 } | 57 } |
| 56 | 58 |
| 57 bool AudioServiceImpl::SetDeviceProperties(const std::string& device_id, | 59 bool AudioServiceImpl::SetDeviceSoundLevel(const std::string& device_id, |
| 58 bool muted, | |
| 59 int volume, | 60 int volume, |
| 60 int gain) { | 61 int gain) { |
| 61 return false; | 62 return false; |
| 62 } | 63 } |
| 63 | 64 |
| 65 bool AudioServiceImpl::SetMuteForDevice(const std::string& device_id, |
| 66 bool value) { |
| 67 return false; |
| 68 } |
| 69 |
| 70 bool AudioServiceImpl::SetMute(bool is_input, bool value) { |
| 71 return false; |
| 72 } |
| 73 |
| 74 bool AudioServiceImpl::GetMute(bool is_input, bool* value) { |
| 75 return false; |
| 76 } |
| 77 |
| 64 } // namespace extensions | 78 } // namespace extensions |
| OLD | NEW |