Home | History | Annotate | Download | only in android
      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  ****************************/
     20 extern void android_eq_init(int sessionId, IEqualizer* ieq);
     21 
     22 extern android::status_t android_eq_setParam(android::sp<android::AudioEffect> pFx,
     23         int32_t param, int32_t param2, void *pValue);
     24 
     25 extern 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  ****************************/
     31 extern void android_bb_init(int sessionId, IBassBoost* ibb);
     32 
     33 extern android::status_t android_bb_setParam(android::sp<android::AudioEffect> pFx,
     34         int32_t param, void *pValue);
     35 
     36 extern android::status_t android_bb_getParam(android::sp<android::AudioEffect> pFx,
     37         int32_t param, void *pValue);
     38 
     39 /**************************************************************************************************
     40  * Virtualizer functions
     41  ****************************/
     42 extern void android_virt_init(int sessionId, IVirtualizer* ivi);
     43 
     44 extern android::status_t android_virt_setParam(android::sp<android::AudioEffect> pFx,
     45         int32_t param, void *pValue);
     46 
     47 extern android::status_t android_virt_getParam(android::sp<android::AudioEffect> pFx,
     48         int32_t param, void *pValue);
     49 
     50 /**************************************************************************************************
     51  * PresetReverb functions
     52  ****************************/
     53 extern void android_prev_init(IPresetReverb* ipr);
     54 
     55 extern android::status_t android_prev_setPreset(android::sp<android::AudioEffect> pFx,
     56         uint16_t preset);
     57 
     58 extern android::status_t android_prev_getPreset(android::sp<android::AudioEffect> pFx,
     59         uint16_t* preset);
     60 
     61 /**************************************************************************************************
     62  * EnvironmentalReverb functions
     63  ****************************/
     64 extern void android_erev_init(IEnvironmentalReverb* ier);
     65 
     66 extern android::status_t android_erev_setParam(android::sp<android::AudioEffect> pFx,
     67         int32_t param, void *pValue);
     68 
     69 extern android::status_t android_erev_getParam(android::sp<android::AudioEffect> pFx,
     70         int32_t param, void *pValue);
     71 
     72 /**************************************************************************************************
     73  * Generic Effect functions
     74  ****************************/
     75 extern SLresult android_genericFx_queryNumEffects(SLuint32 *pNumSupportedAudioEffects);
     76 
     77 extern SLresult android_genericFx_queryEffect(SLuint32 index, effect_descriptor_t* pDescriptor);
     78 
     79 extern SLresult android_genericFx_createEffect(IAndroidEffect* iae, SLInterfaceID pUuid,
     80         int sessionId);
     81 
     82 extern SLresult android_genericFx_releaseEffect(IAndroidEffect* iae, SLInterfaceID pUuid);
     83 
     84 extern SLresult android_genericFx_setEnabled(IAndroidEffect* iae, SLInterfaceID pUuid,
     85         SLboolean enabled);
     86 
     87 extern SLresult android_genericFx_isEnabled(IAndroidEffect* iae, SLInterfaceID pUuid,
     88         SLboolean *pEnabled);
     89 
     90 extern SLresult android_genericFx_sendCommand(IAndroidEffect* iae, SLInterfaceID pUuid,
     91         SLuint32 command, SLuint32 commandSize, void* pCommandData,
     92         SLuint32 *replySize, void *pReplyData);
     93 
     94 extern 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  */
    104 extern 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  */
    111 extern SLresult android_fxSend_attachToAux(CAudioPlayer* ap, SLInterfaceID pUuid,
    112         SLboolean attach, SLmillibel sendLevel);
    113 
    114 /**
    115  * sendLevel is the total energy going to the send bus. This implies that the volume attenuation
    116  *   should be combined with the send level for the aux level to follow volume changes.
    117  */
    118 extern android::status_t android_fxSend_setSendLevel(CAudioPlayer* ap, SLmillibel sendLevel);
    119 
    120 /**************************************************************************************************
    121  * Effect-agnostic functions
    122  ****************************/
    123 extern android::status_t android_fx_setParam(android::sp<android::AudioEffect> pFx,
    124         int32_t param, uint32_t paramSizeMax, void *pValue, uint32_t valueSize);
    125 
    126 extern android::status_t android_fx_getParam(android::sp<android::AudioEffect> pFx,
    127         int32_t param, uint32_t paramSizeMax, void *pValue, uint32_t valueSize);
    128 
    129 extern SLresult android_fx_statusToResult(android::status_t status);
    130 
    131 extern bool android_fx_initEffectObj(int sessionId, android::sp<android::AudioEffect>& effect,
    132         const effect_uuid_t *type);
    133 
    134 extern bool android_fx_initEffectDescriptor(const SLInterfaceID effectId,
    135         effect_descriptor_t* fxDescrLoc);
    136