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 int32_t GetMaxVolume(AudioVolumeType volumeType) override; 30 int32_t GetMinVolume(AudioVolumeType volumeType) override; 31 int32_t SetMicrophoneMute(bool isMute) override; 32 bool IsMicrophoneMute() override; 33 int32_t SetVoiceVolume(float volume) override; 34 int32_t SetAudioScene(AudioScene audioScene, DeviceType activeDevice) override; 35 std::vector<sptr<AudioDeviceDescriptor>> GetDevices(DeviceFlag deviceFlag) override; 36 const std::string GetAudioParameter(const std::string &key) override; 37 const std::string GetAudioParameter(const std::string& networkId, const AudioParamKey key, 38 const std::string& condition) override; 39 void SetAudioParameter(const std::string &key, const std::string &value) override; 40 void SetAudioParameter(const std::string& networkId, const AudioParamKey key, const std::string& condition, 41 const std::string& value) override; 42 int32_t UpdateActiveDeviceRoute(DeviceType type, DeviceFlag flag) override; 43 const char *RetrieveCookie(int32_t &size) override; 44 uint64_t GetTransactionId(DeviceType deviceType, DeviceRole deviceRole) override; 45 void NotifyDeviceInfo(std::string networkId, bool connected) override; 46 int32_t CheckRemoteDeviceState(std::string networkId, DeviceRole deviceRole, bool isStartDevice) override; 47 int32_t SetParameterCallback(const sptr<IRemoteObject>& object) override; 48 void SetAudioMonoState(bool audioMono) override; 49 void SetAudioBalanceValue(float audioBalance) override; 50 private: 51 static inline BrokerDelegator<AudioManagerProxy> delegator_; 52 }; 53 } // namespace AudioStandard 54 } // namespace OHOS 55 #endif // ST_AUDIO_MANAGER_PROXY_H 56