1/* 2 * Copyright (c) 2023 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 16package ohos.hdi.audio.effect.v1_0; 17import ohos.hdi.audio.effect.v1_0.EffectTypes; 18import ohos.hdi.audio.effect.v1_0.IEffectControl; 19 20interface IEffectModel { 21 /** 22 * @brief Query whether the vendor/OEM supplies effect libraries. If supplies, use the supplied effect libraries. 23 * If not, use the system service software effect. 24 * 25 * @param model Indicates the pointer to the effect model to operate. 26 * @param supply indicates the state whether the vendor/OEM supplies effect libraries. 27 * 28 * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise. 29 * 30 * @since 4.0 31 * @version 1.0 32 */ 33 IsSupplyEffectLibs([out] boolean supply); 34 35 /** 36 * @brief Get descriptors of all supported audio effects. 37 * 38 * @param model Indicates the pointer to the effect model to operate. 39 * @param descs Indicates the effect list. 40 * 41 * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise. 42 * 43 * @since 4.0 44 * @version 1.0 45 */ 46 GetAllEffectDescriptors([out] struct EffectControllerDescriptor[] descs); 47 48 /** 49 * @brief Create an effect controller which is used to operate the effect instance. 50 * 51 * @param model Indicates the pointer to the effect model to operate. 52 * @param info Indicates the effect information. 53 * @param contoller Indicates the <b>IEffectControl</b> object. 54 * @param contollerId Indicates the contoller to the <b>IEffectControl</b> object. 55 * 56 * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise. 57 * 58 * @since 4.0 59 * @version 1.0 60 */ 61 CreateEffectController([in]struct EffectInfo info, [out] IEffectControl contoller, 62 [out] struct ControllerId id); 63 64 /** 65 * @brief Destroy the effect controller specified by the controllerId. 66 * 67 * @param model Indicates the pointer to the effect model to operate. 68 * @param contollerId Indicates the contoller to the <b>EffectControl</b> object. 69 * 70 * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise. 71 * 72 * @since 4.0 73 * @version 1.0 74 */ 75 DestroyEffectController([in] struct ControllerId id); 76 77 /** 78 * @brief Get a descriptor of specified effect. 79 * 80 * @param model Indicates the pointer to the effect model to operate. 81 * @param effectId Indicates the effectId of the effect. 82 * @param desc Indicates the specified effect descriptor. 83 * 84 * @return Returns <b>0</b> if the process success; returns a non-zero value otherwise. 85 * 86 * @since 4.0 87 * @version 1.0 88 */ 89 GetEffectDescriptor([in] String effectId, [out] struct EffectControllerDescriptor desc); 90} 91