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;
18
19interface IEffectControl {
20    /**
21     * @brief Process the audio raw data.
22     * the input and output buffer have to be specificed, if they are not specified,the process have to use the
23     * data process function which is provided by the command.
24     *
25     * @param control Indicates the pointer to the effect control to operate.
26     * @param input Indicates the buffer for original data.
27     * @param output Indicates the buffer for output data.
28     *
29     * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise.
30     *
31     * @since 4.0
32     * @version 1.0
33     */
34    EffectProcess([in] struct AudioEffectBuffer input, [out] struct AudioEffectBuffer output);
35
36    /**
37     * @brief Send the effect processing command.
38     *
39     * @param control Indicates the pointer to the effect control to operate.
40     * @param cmdId Command index used to match command options in the command table.
41     * @param cmdData Data comes from the system service.
42     * @param cmdDataLen to the length of the cmdData.
43     * @param replyData Data comes from vendor.
44     * @param replyDataLen Indicates the pointer to the length of the replyData.
45     *
46     * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise.
47     *
48     * @since 4.0
49     * @version 1.0
50     */
51    SendCommand([in] unsigned int cmdId, [in] byte[] cmdData, [out] byte[] replyData);
52
53    /**
54     * @brief Get the descriptor of the effect.
55     *
56     * @param control Indicates the pointer to the effect control to operate.
57     * @param desc Indicates the specified effect descriptor.
58     *
59     * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise.
60     *
61     * @since 4.0
62     * @version 1.0
63     */
64    GetEffectDescriptor([out] struct EffectControllerDescriptor desc);
65
66    /**
67     * @brief Reverse the audio processed data.
68     * the input and output buffer have to be specificed, if they are not specified,the reverse have to use the
69     * data reverse function which is provided by the command.
70     *
71     * @param control Indicates the pointer to the effect control to operate.
72     * @param input Indicates the buffer for input data.
73     * @param output Indicates the buffer for output data.
74     *
75     * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise.
76     *
77     * @since 4.0
78     * @version 1.0
79     */
80    EffectReverse([in] struct AudioEffectBuffer input, [out] struct AudioEffectBuffer output);
81}