android_Effect.h revision 5b09aa864215690580b18eb802927e8cc7eb4861
1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/**************************************************************************************************
18 * Equalizer functions
19 ****************************/
20extern void android_eq_init(int sessionId, IEqualizer* ieq);
21
22extern android::status_t android_eq_setParam(android::sp<android::AudioEffect> pFx,
23        int32_t param, int32_t param2, void *pValue);
24
25extern android::status_t android_eq_getParam(android::sp<android::AudioEffect> pFx,
26        int32_t param, int32_t param2, void *pValue);
27
28/**************************************************************************************************
29 * BassBoost functions
30 ****************************/
31extern void android_bb_init(int sessionId, IBassBoost* ibb);
32
33extern android::status_t android_bb_setParam(android::sp<android::AudioEffect> pFx,
34        int32_t param, void *pValue);
35
36extern android::status_t android_bb_getParam(android::sp<android::AudioEffect> pFx,
37        int32_t param, void *pValue);
38
39/**************************************************************************************************
40 * Virtualizer functions
41 ****************************/
42extern void android_virt_init(int sessionId, IVirtualizer* ivi);
43
44extern android::status_t android_virt_setParam(android::sp<android::AudioEffect> pFx,
45        int32_t param, void *pValue);
46
47extern android::status_t android_virt_getParam(android::sp<android::AudioEffect> pFx,
48        int32_t param, void *pValue);
49
50/**************************************************************************************************
51 * PresetReverb functions
52 ****************************/
53extern void android_prev_init(IPresetReverb* ipr);
54
55extern android::status_t android_prev_setPreset(android::sp<android::AudioEffect> pFx,
56        uint16_t preset);
57
58extern android::status_t android_prev_getPreset(android::sp<android::AudioEffect> pFx,
59        uint16_t* preset);
60
61/**************************************************************************************************
62 * EnvironmentalReverb functions
63 ****************************/
64extern void android_erev_init(IEnvironmentalReverb* ier);
65
66/**************************************************************************************************
67 * Generic Effect functions
68 ****************************/
69extern SLresult android_genericFx_queryNumEffects(SLuint32 *pNumSupportedAudioEffects);
70
71extern SLresult android_genericFx_queryEffect(SLuint32 index, effect_descriptor_t* pDescriptor);
72
73extern SLresult android_genericFx_createEffect(IAndroidEffect* iae, SLInterfaceID pUuid,
74        int sessionId);
75
76extern SLresult android_genericFx_releaseEffect(IAndroidEffect* iae, SLInterfaceID pUuid);
77
78extern SLresult android_genericFx_setEnabled(IAndroidEffect* iae, SLInterfaceID pUuid,
79        SLboolean enabled);
80
81extern SLresult android_genericFx_isEnabled(IAndroidEffect* iae, SLInterfaceID pUuid,
82        SLboolean *pEnabled);
83
84extern SLresult android_genericFx_sendCommand(IAndroidEffect* iae, SLInterfaceID pUuid,
85        SLuint32 command, SLuint32 commandSize, void* pCommandData,
86        SLuint32 *replySize, void *pReplyData);
87
88/**************************************************************************************************
89 * EffectSend functions
90 ****************************/
91extern android::status_t android_fxSend_attach(CAudioPlayer* ap, bool attach,
92        android::sp<android::AudioEffect> pFx, SLmillibel sendLevel);
93
94extern android::status_t android_fxSend_setSendLevel(CAudioPlayer* ap, SLmillibel sendLevel);
95
96/**************************************************************************************************
97 * Effect-agnostic functions
98 ****************************/
99extern android::status_t android_fx_setParam(android::sp<android::AudioEffect> pFx,
100        int32_t param, uint32_t paramSizeMax, void *pValue, uint32_t valueSize);
101
102extern android::status_t android_fx_getParam(android::sp<android::AudioEffect> pFx,
103        int32_t param, uint32_t paramSizeMax, void *pValue, uint32_t valueSize);
104
105extern SLresult android_fx_statusToResult(android::status_t status);
106
107extern bool android_fx_initEffectObj(int sessionId, android::sp<android::AudioEffect>& effect,
108        const effect_uuid_t *type,  const effect_uuid_t *uuid);
109
110extern bool android_fx_initEffectDescriptor(const SLInterfaceID effectId,
111        effect_descriptor_t* fxDescrLoc);
112
113