• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef ST_AUDIO_MANAGER_PROXY_H
17 #define ST_AUDIO_MANAGER_PROXY_H
18 
19 #include "iremote_proxy.h"
20 #include "audio_system_manager.h"
21 #include "audio_manager_base.h"
22 
23 namespace OHOS {
24 namespace AudioStandard {
25 class AudioManagerProxy : public IRemoteProxy<IStandardAudioService> {
26 public:
27     explicit AudioManagerProxy(const sptr<IRemoteObject> &impl);
28     virtual ~AudioManagerProxy() = default;
29 
30     int32_t SetMicrophoneMute(bool isMute) override;
31     bool IsMicrophoneMute() override;
32     int32_t SetVoiceVolume(float volume) override;
33     int32_t SetAudioScene(AudioScene audioScene, DeviceType activeDevice) override;
34     std::vector<sptr<AudioDeviceDescriptor>> GetDevices(DeviceFlag deviceFlag) override;
35     const std::string GetAudioParameter(const std::string &key) override;
36     const std::string GetAudioParameter(const std::string& networkId, const AudioParamKey key,
37         const std::string& condition) override;
38     void SetAudioParameter(const std::string &key, const std::string &value) override;
39     void SetAudioParameter(const std::string& networkId, const AudioParamKey key, const std::string& condition,
40         const std::string& value) override;
41     int32_t UpdateActiveDeviceRoute(DeviceType type, DeviceFlag flag) override;
42     const char *RetrieveCookie(int32_t &size) override;
43     uint64_t GetTransactionId(DeviceType deviceType, DeviceRole deviceRole) override;
44     void NotifyDeviceInfo(std::string networkId, bool connected) override;
45     int32_t CheckRemoteDeviceState(std::string networkId, DeviceRole deviceRole, bool isStartDevice) override;
46     int32_t SetParameterCallback(const sptr<IRemoteObject>& object) override;
47     int32_t SetWakeupSourceCallback(const sptr<IRemoteObject>& object) override;
48     void SetAudioMonoState(bool audioMono) override;
49     void SetAudioBalanceValue(float audioBalance) override;
50     sptr<IRemoteObject> CreateAudioProcess(const AudioProcessConfig &config) override;
51     bool LoadAudioEffectLibraries(const std::vector<Library> libraries, const std::vector<Effect> effects,
52         std::vector<Effect> &successEffects) override;
53     void RequestThreadPriority(uint32_t tid, std::string bundleName) override;
54     bool CreateEffectChainManager(std::vector<EffectChain> &effectChains,
55         std::unordered_map<std::string, std::string> &map) override;
56     bool SetOutputDeviceSink(int32_t deviceType, std::string &sinkName) override;
57     bool CreatePlaybackCapturerManager() override;
58     int32_t SetSupportStreamUsage(std::vector<int32_t> usage) override;
59     int32_t RegiestPolicyProvider(const sptr<IRemoteObject> &object) override;
60     int32_t SetCaptureSilentState(bool state) override;
61 private:
62     static inline BrokerDelegator<AudioManagerProxy> delegator_;
63 };
64 } // namespace AudioStandard
65 } // namespace OHOS
66 #endif // ST_AUDIO_MANAGER_PROXY_H
67