• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 supply indicates the state whether the vendor/OEM supplies effect libraries.
26     *
27     * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise.
28     *
29     * @since 4.0
30     * @version 1.0
31     */
32    IsSupplyEffectLibs([out] boolean supply);
33
34    /**
35     * @brief Get descriptors of all supported audio effects.
36     *
37     * @param descs Indicates the effect list.
38     *
39     * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise.
40     *
41     * @since 4.0
42     * @version 1.0
43     */
44    GetAllEffectDescriptors([out] struct EffectControllerDescriptor[] descs);
45
46    /**
47     * @brief Create an effect controller which is used to operate the effect instance.
48     *
49     * @param contoller Indicates the <b>IEffectControl</b> object.
50     * @param contollerId Indicates the contoller to the <b>IEffectControl</b> object.
51     *
52     * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise.
53     *
54     * @since 4.0
55     * @version 1.0
56     */
57    CreateEffectController([in]struct EffectInfo info, [out] IEffectControl contoller,
58                           [out] struct ControllerId id);
59
60    /**
61     * @brief Destroy the effect controller specified by the controllerId.
62     *
63     * @param contollerId Indicates the contoller to the <b>EffectControl</b> object.
64     *
65     * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise.
66     *
67     * @since 4.0
68     * @version 1.0
69     */
70    DestroyEffectController([in] struct ControllerId id);
71
72    /**
73     * @brief Get a descriptor of specified effect.
74     *
75     * @param effectId Indicates the effectId of the effect.
76     * @param desc Indicates the specified effect descriptor.
77     *
78     * @return Returns <b>0</b> if the process success; returns a non-zero value otherwise.
79     *
80     * @since 4.0
81     * @version 1.0
82     */
83    GetEffectDescriptor([in] String effectId, [out] struct EffectControllerDescriptor desc);
84}
85