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 66extern android::status_t android_erev_setParam(android::sp<android::AudioEffect> pFx, 67 int32_t param, void *pValue); 68 69extern android::status_t android_erev_getParam(android::sp<android::AudioEffect> pFx, 70 int32_t param, void *pValue); 71 72/************************************************************************************************** 73 * Generic Effect functions 74 ****************************/ 75extern SLresult android_genericFx_queryNumEffects(SLuint32 *pNumSupportedAudioEffects); 76 77extern SLresult android_genericFx_queryEffect(SLuint32 index, effect_descriptor_t* pDescriptor); 78 79extern SLresult android_genericFx_createEffect(IAndroidEffect* iae, SLInterfaceID pUuid, 80 int sessionId); 81 82extern SLresult android_genericFx_releaseEffect(IAndroidEffect* iae, SLInterfaceID pUuid); 83 84extern SLresult android_genericFx_setEnabled(IAndroidEffect* iae, SLInterfaceID pUuid, 85 SLboolean enabled); 86 87extern SLresult android_genericFx_isEnabled(IAndroidEffect* iae, SLInterfaceID pUuid, 88 SLboolean *pEnabled); 89 90extern SLresult android_genericFx_sendCommand(IAndroidEffect* iae, SLInterfaceID pUuid, 91 SLuint32 command, SLuint32 commandSize, void* pCommandData, 92 SLuint32 *replySize, void *pReplyData); 93 94extern bool android_genericFx_hasEffect(IAndroidEffect* iae, SLInterfaceID pUuid); 95 96 97/************************************************************************************************** 98 * EffectSend functions 99 ****************************/ 100/** 101 * sendLevel is the total energy going to the send bus. This implies that the volume attenuation 102 * should be combined with the send level for the aux level to follow volume changes. 103 */ 104extern android::status_t android_fxSend_attach(CAudioPlayer* ap, bool attach, 105 android::sp<android::AudioEffect> pFx, SLmillibel sendLevel); 106 107/** 108 * sendLevel is the total energy going to the send bus. This implies that the volume attenuation 109 * should be combined with the send level for the aux level to follow volume changes. 110 * This one is used by Android-specific APIs, not portable Khronos APIs. 111 */ 112extern SLresult android_fxSend_attachToAux(CAudioPlayer* ap, SLInterfaceID pUuid, 113 SLboolean attach, SLmillibel sendLevel); 114 115/** 116 * sendLevel is the total energy going to the send bus. This implies that the volume attenuation 117 * should be combined with the send level for the aux level to follow volume changes. 118 */ 119extern android::status_t android_fxSend_setSendLevel(CAudioPlayer* ap, SLmillibel sendLevel); 120 121/************************************************************************************************** 122 * Effect-agnostic functions 123 ****************************/ 124extern android::status_t android_fx_setParam(android::sp<android::AudioEffect> pFx, 125 int32_t param, uint32_t paramSizeMax, void *pValue, uint32_t valueSize); 126 127extern android::status_t android_fx_getParam(android::sp<android::AudioEffect> pFx, 128 int32_t param, uint32_t paramSizeMax, void *pValue, uint32_t valueSize); 129 130extern SLresult android_fx_statusToResult(android::status_t status); 131 132extern bool android_fx_initEffectObj(int sessionId, android::sp<android::AudioEffect>& effect, 133 const effect_uuid_t *type); 134 135extern bool android_fx_initEffectDescriptor(const SLInterfaceID effectId, 136 effect_descriptor_t* fxDescrLoc); 137