1 /* 2 * Copyright (c) 2024 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 #ifndef NAPI_AUDIO_EFFECT_MANAGER_H 16 #define NAPI_AUDIO_EFFECT_MANAGER_H 17 18 #include <iostream> 19 #include <map> 20 #include <vector> 21 #include "napi/native_api.h" 22 #include "napi/native_node_api.h" 23 #include "napi_async_work.h" 24 #include "audio_system_manager.h" 25 #include "audio_effect_manager.h" 26 27 namespace OHOS { 28 namespace AudioStandard { 29 const std::string AUDIO_EFFECT_MGR_NAPI_CLASS_NAME = "AudioEffectManager"; 30 31 class NapiAudioEffectMgr { 32 public: 33 NapiAudioEffectMgr(); 34 ~NapiAudioEffectMgr(); 35 36 static napi_value Init(napi_env env, napi_value exports); 37 static napi_value CreateEffectManagerWrapper(napi_env env); 38 39 private: 40 static napi_value Construct(napi_env env, napi_callback_info info); 41 static void Destructor(napi_env env, void *nativeObject, void *finalizeHint); 42 static NapiAudioEffectMgr *GetParamWithSync(const napi_env &env, napi_callback_info info, 43 size_t &argc, napi_value *args); 44 45 static napi_value GetSupportedAudioEffectProperty(napi_env env, napi_callback_info info); 46 static napi_value GetAudioEffectProperty(napi_env env, napi_callback_info info); 47 static napi_value SetAudioEffectProperty(napi_env env, napi_callback_info info); 48 49 napi_env env_; 50 AudioEffectManager *audioEffectMngr_; 51 int32_t cachedClientId_ = -1; 52 }; 53 } // namespace AudioStandard 54 } // namespace OHOS 55 #endif /* NAPI_AUDIO_EFFECT_MANAGER_H */ 56