Home | History | Annotate | Download | only in Bundle

Lines Matching refs:pBundledContext

213         GlobalSessionMemory[sessionNo].pBundledContext        = new BundledEffectContext;
216 pContext->pBundledContext = GlobalSessionMemory[sessionNo].pBundledContext;
217 pContext->pBundledContext->SessionNo = sessionNo;
218 pContext->pBundledContext->SessionId = sessionId;
219 pContext->pBundledContext->hInstance = NULL;
220 pContext->pBundledContext->bVolumeEnabled = LVM_FALSE;
221 pContext->pBundledContext->bEqualizerEnabled = LVM_FALSE;
222 pContext->pBundledContext->bBassEnabled = LVM_FALSE;
223 pContext->pBundledContext->bBassTempDisabled = LVM_FALSE;
224 pContext->pBundledContext->bVirtualizerEnabled = LVM_FALSE;
225 pContext->pBundledContext->bVirtualizerTempDisabled = LVM_FALSE;
226 pContext->pBundledContext->nOutputDevice = AUDIO_DEVICE_NONE;
227 pContext->pBundledContext->nVirtualizerForcedDevice = AUDIO_DEVICE_NONE;
228 pContext->pBundledContext->NumberEffectsEnabled = 0;
229 pContext->pBundledContext->NumberEffectsCalled = 0;
230 pContext->pBundledContext->firstVolume = LVM_TRUE;
231 pContext->pBundledContext->volume = 0;
235 snprintf(fileName, 256, "/data/tmp/bundle_%p_pcm_in.pcm", pContext->pBundledContext);
236 pContext->pBundledContext->PcmInPtr = fopen(fileName, "w");
237 if (pContext->pBundledContext->PcmInPtr == NULL) {
243 snprintf(fileName, 256, "/data/tmp/bundle_%p_pcm_out.pcm", pContext->pBundledContext);
244 pContext->pBundledContext->PcmOutPtr = fopen(fileName, "w");
245 if (pContext->pBundledContext->PcmOutPtr == NULL) {
247 fclose(pContext->pBundledContext->PcmInPtr);
248 pContext->pBundledContext->PcmInPtr = NULL;
258 pContext->pBundledContext->BassStrengthSaved = 0;
259 pContext->pBundledContext->VirtStrengthSaved = 0;
260 pContext->pBundledContext->CurPreset = PRESET_CUSTOM;
261 pContext->pBundledContext->levelSaved = 0;
262 pContext->pBundledContext->bMuteEnabled = LVM_FALSE;
263 pContext->pBundledContext->bStereoPositionEnabled = LVM_FALSE;
264 pContext->pBundledContext->positionSaved = 0;
265 pContext->pBundledContext->workBuffer = NULL;
266 pContext->pBundledContext->frameCount = -1;
267 pContext->pBundledContext->SamplesToExitCountVirt = 0;
268 pContext->pBundledContext->SamplesToExitCountBb = 0;
269 pContext->pBundledContext->SamplesToExitCountEq = 0;
272 pContext->pBundledContext->bandGaindB[i] = EQNB_5BandSoftPresets[i];
286 pContext->pBundledContext =
287 GlobalSessionMemory[sessionNo].pBundledContext;
289 ALOGV("\tEffectCreate - pBundledContext is %p", pContext->pBundledContext);
291 pSessionContext = &GlobalSessionMemory[pContext->pBundledContext->SessionNo];
298 pContext->pBundledContext->SamplesToExitCountBb = 0;
306 pContext->pBundledContext->SamplesToExitCountVirt = 0;
314 pContext->pBundledContext->SamplesToExitCountEq = 0;
338 delete pContext->pBundledContext;
354 ALOGV("\tEffectRelease start handle: %p, context %p", handle, pContext->pBundledContext);
360 SessionContext *pSessionContext = &GlobalSessionMemory[pContext->pBundledContext->SessionNo];
367 if(pContext->pBundledContext->SamplesToExitCountBb > 0){
368 pContext->pBundledContext->NumberEffectsEnabled--;
370 pContext->pBundledContext->SamplesToExitCountBb = 0;
374 if(pContext->pBundledContext->SamplesToExitCountVirt > 0){
375 pContext->pBundledContext->NumberEffectsEnabled--;
377 pContext->pBundledContext->SamplesToExitCountVirt = 0;
381 if(pContext->pBundledContext->SamplesToExitCountEq > 0){
382 pContext->pBundledContext->NumberEffectsEnabled--;
384 pContext->pBundledContext->SamplesToExitCountEq = 0;
388 if (pContext->pBundledContext->bVolumeEnabled == LVM_TRUE){
389 pContext->pBundledContext->NumberEffectsEnabled--;
406 if (pContext->pBundledContext->PcmInPtr != NULL) {
407 fclose(pContext->pBundledContext->PcmInPtr);
408 pContext->pBundledContext->PcmInPtr = NULL;
410 if (pContext->pBundledContext->PcmOutPtr != NULL) {
411 fclose(pContext->pBundledContext->PcmOutPtr);
412 pContext->pBundledContext->PcmOutPtr = NULL;
419 if(SessionIndex[i] == pContext->pBundledContext->SessionId){
422 i, pContext->pBundledContext->SessionId);
429 pSessionContext->pBundledContext = LVM_NULL;
432 ALOGV("\tEffectRelease: Deleting LVM Bundle context %p\n", pContext->pBundledContext);
433 if (pContext->pBundledContext->workBuffer != NULL) {
434 free(pContext->pBundledContext->workBuffer);
436 delete pContext->pBundledContext;
437 pContext->pBundledContext = LVM_NULL;
483 GlobalSessionMemory[i].pBundledContext = LVM_NULL;
526 if (pContext->pBundledContext->hInstance != NULL){
598 pContext->pBundledContext->hInstance = LVM_NULL;
601 LvmStatus = LVM_GetInstanceHandle(&pContext->pBundledContext->hInstance,
617 pContext->pBundledContext->SampleRate = LVM_FS_44100;
664 LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance,
683 LvmStatus = LVM_SetHeadroomParams(pContext->pBundledContext->hInstance,
725 if (pContext->pBundledContext->frameCount != frameCount) {
726 if (pContext->pBundledContext->workBuffer != NULL) {
727 free(pContext->pBundledContext->workBuffer);
729 pContext->pBundledContext->workBuffer =
731 pContext->pBundledContext->frameCount = frameCount;
733 pOutTmp = pContext->pBundledContext->workBuffer;
740 fwrite(pIn, frameCount*sizeof(LVM_INT16)*2, 1, pContext->pBundledContext->PcmInPtr);
741 fflush(pContext->pBundledContext->PcmInPtr);
747 LvmStatus = LVM_Process(pContext->pBundledContext->hInstance, /* Instance handle */
757 fwrite(pOutTmp, frameCount*sizeof(LVM_INT16)*2, 1, pContext->pBundledContext->PcmOutPtr);
758 fflush(pContext->pBundledContext->PcmOutPtr);
788 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance,
811 LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
838 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance,
861 LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
888 LvmStatus = LVM_GetMemoryTable(pContext->pBundledContext->hInstance,
947 pContext->pBundledContext->SamplesPerSecond = 8000*2; // 2 secs Stereo
951 pContext->pBundledContext->SamplesPerSecond = 16000*2; // 2 secs Stereo
955 pContext->pBundledContext->SamplesPerSecond = 22050*2; // 2 secs Stereo
959 pContext->pBundledContext->SamplesPerSecond = 32000*2; // 2 secs Stereo
963 pContext->pBundledContext->SamplesPerSecond = 44100*2; // 2 secs Stereo
967 pContext->pBundledContext->SamplesPerSecond = 48000*2; // 2 secs Stereo
974 if(pContext->pBundledContext->SampleRate != SampleRate){
982 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance,
990 LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
994 pContext->pBundledContext->SampleRate = SampleRate;
1038 //ALOGV("\tBassGetStrength() (0-1000) -> %d\n", pContext->pBundledContext->BassStrengthSaved);
1043 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance,
1053 (LVM_INT16)((15*pContext->pBundledContext->BassStrengthSaved)/1000)){
1055 ActiveParams.BE_EffectLevel, pContext->pBundledContext->BassStrengthSaved);
1060 //ALOGV("\tBassGetStrength() (saved) -> %d\n", pContext->pBundledContext->BassStrengthSaved );
1061 return pContext->pBundledContext->BassStrengthSaved;
1079 pContext->pBundledContext->BassStrengthSaved = (int)strength;
1085 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance,
1098 LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
1119 //ALOGV("\tVirtualizerGetStrength (0-1000) -> %d\n",pContext->pBundledContext->VirtStrengthSaved);
1124 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
1131 return pContext->pBundledContext->VirtStrengthSaved;
1151 pContext->pBundledContext->VirtStrengthSaved = (int)strength;
1154 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance,&ActiveParams);
1166 pBundledContext->hInstance, &ActiveParams);
1233 forcedDevice, pContext->pBundledContext->bVirtualizerEnabled,
1234 pContext->pBundledContext->bVirtualizerTempDisabled);
1248 if (VirtualizerIsDeviceSupported(pContext->pBundledContext->nOutputDevice) == 0) {
1249 useVirtualizer = (pContext->pBundledContext->bVirtualizerEnabled == LVM_TRUE);
1251 pContext->pBundledContext->nVirtualizerForcedDevice = AUDIO_DEVICE_NONE;
1254 pContext->pBundledContext->nVirtualizerForcedDevice = AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
1256 useVirtualizer = (pContext->pBundledContext->bVirtualizerEnabled == LVM_TRUE);
1260 if (pContext->pBundledContext->bVirtualizerTempDisabled == LVM_TRUE) {
1263 pContext->pBundledContext->bVirtualizerTempDisabled = LVM_FALSE;
1268 if (pContext->pBundledContext->bVirtualizerTempDisabled == LVM_FALSE) {
1271 pContext->pBundledContext->bVirtualizerTempDisabled = LVM_TRUE;
1278 pContext->pBundledContext->bVirtualizerEnabled,
1279 pContext->pBundledContext->bVirtualizerTempDisabled);
1329 if ((pContext->pBundledContext->bVirtualizerEnabled == LVM_TRUE)
1330 && (pContext->pBundledContext->bVirtualizerTempDisabled == LVM_FALSE)) {
1331 if (pContext->pBundledContext->nVirtualizerForcedDevice != AUDIO_DEVICE_NONE) {
1333 virtDevice = pContext->pBundledContext->nVirtualizerForcedDevice;
1336 virtDevice = pContext->pBundledContext->nOutputDevice;
1360 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
1374 if (pContext->pBundledContext->bandGaindB[i] >= maxGain) {
1375 int tmpMaxGain = pContext->pBundledContext->bandGaindB[i];
1379 int gain = pContext->pBundledContext->bandGaindB[j];
1406 ActiveParams.pEQNB_BandDefinition[i].Gain = pContext->pBundledContext->bandGaindB[i];
1410 if (maxGain + pContext->pBundledContext->volume > 0) {
1411 gainCorrection = maxGain + pContext->pBundledContext->volume;
1420 ActiveParams.VC_EffectLevel = pContext->pBundledContext->volume - gainCorrection;
1426 LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
1432 if(pContext->pBundledContext->firstVolume == LVM_TRUE){
1433 LvmStatus = LVM_SetVolumeNoSmoothing(pContext->pBundledContext->hInstance, &ActiveParams);
1436 pContext->pBundledContext->firstVolume = LVM_FALSE;
1454 //ALOGV("\tEqualizerGetBandLevel -> %d\n", pContext->pBundledContext->bandGaindB[band] );
1455 return pContext->pBundledContext->bandGaindB[band] * 100;
1480 pContext->pBundledContext->bandGaindB[band] = gainRounded;
1481 pContext->pBundledContext->CurPreset = PRESET_CUSTOM;
1505 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance,
1590 return pContext->pBundledContext->CurPreset;
1609 pContext->pBundledContext->CurPreset = preset;
1614 pContext->pBundledContext->bandGaindB[i] =
1667 if (pContext->pBundledContext->bMuteEnabled == LVM_TRUE) {
1668 pContext->pBundledContext->levelSaved = level / 100;
1670 pContext->pBundledContext->volume = level / 100;
1690 if (pContext->pBundledContext->bMuteEnabled == LVM_TRUE) {
1691 *level = pContext->pBundledContext->levelSaved * 100;
1693 *level = pContext->pBundledContext->volume * 100;
1712 pContext->pBundledContext->bMuteEnabled = mute;
1715 if(pContext->pBundledContext->bMuteEnabled == LVM_TRUE){
1716 pContext->pBundledContext->levelSaved = pContext->pBundledContext->volume;
1717 pContext->pBundledContext->volume = -96;
1719 pContext->pBundledContext->volume = pContext->pBundledContext->levelSaved;
1741 if((pContext->pBundledContext->bMuteEnabled == LVM_FALSE)||
1742 (pContext->pBundledContext->bMuteEnabled == LVM_TRUE)){
1743 *mute = pContext->pBundledContext->bMuteEnabled;
1747 pContext->pBundledContext->bMuteEnabled);
1781 pContext->pBundledContext->positionSaved = position;
1782 Balance = VolumeConvertStereoPosition(pContext->pBundledContext->positionSaved);
1784 //ALOGV("\tVolumeSetStereoPosition start pContext->pBundledContext->positionSaved = %d",
1785 //pContext->pBundledContext->positionSaved);
1787 if(pContext->pBundledContext->bStereoPositionEnabled == LVM_TRUE){
1790 pContext->pBundledContext->positionSaved = position;
1792 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
1803 LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
1810 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
1820 //ALOGV("\tVolumeSetStereoPosition end pContext->pBundledContext->positionSaved = %d\n",
1821 //pContext->pBundledContext->positionSaved);
1845 //ALOGV("\tVolumeGetStereoPosition start pContext->pBundledContext->positionSaved = %d",
1846 //pContext->pBundledContext->positionSaved);
1848 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
1855 balance = VolumeConvertStereoPosition(pContext->pBundledContext->positionSaved);
1857 if(pContext->pBundledContext->bStereoPositionEnabled == LVM_TRUE){
1862 *position = (LVM_INT16)pContext->pBundledContext->positionSaved; // Convert dB to millibels
1863 //ALOGV("\tVolumeGetStereoPosition end returning pContext->pBundledContext->positionSaved =%d\n",
1864 //pContext->pBundledContext->positionSaved);
1882 pContext->pBundledContext->bStereoPositionEnabled = enabled;
1888 LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
1897 if(pContext->pBundledContext->bStereoPositionEnabled == LVM_FALSE){
1901 VolumeConvertStereoPosition(pContext->pBundledContext->positionSaved);
1905 LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
2533 *(int32_t *)pValue = pContext->pBundledContext->bStereoPositionEnabled;
2595 status = VolumeSetStereoPosition(pContext, pContext->pBundledContext->positionSaved);
2686 if (pContext->pBundledContext->bBassEnabled == LVM_TRUE) {
2690 if(pContext->pBundledContext->SamplesToExitCountBb <= 0){
2691 pContext->pBundledContext->NumberEffectsEnabled++;
2693 pContext->pBundledContext->SamplesToExitCountBb =
2694 (LVM_INT32)(pContext->pBundledContext->SamplesPerSecond*0.1);
2695 pContext->pBundledContext->bBassEnabled = LVM_TRUE;
2696 tempDisabled = pContext->pBundledContext->bBassTempDisabled;
2699 if (pContext->pBundledContext->bEqualizerEnabled == LVM_TRUE) {
2703 if(pContext->pBundledContext->SamplesToExitCountEq <= 0){
2704 pContext->pBundledContext->NumberEffectsEnabled++;
2706 pContext->pBundledContext->SamplesToExitCountEq =
2707 (LVM_INT32)(pContext->pBundledContext->SamplesPerSecond*0.1);
2708 pContext->pBundledContext->bEqualizerEnabled = LVM_TRUE;
2711 if (pContext->pBundledContext->bVirtualizerEnabled == LVM_TRUE) {
2715 if(pContext->pBundledContext->SamplesToExitCountVirt <= 0){
2716 pContext->pBundledContext->NumberEffectsEnabled++;
2718 pContext->pBundledContext->SamplesToExitCountVirt =
2719 (LVM_INT32)(pContext->pBundledContext->SamplesPerSecond*0.1);
2720 pContext->pBundledContext->bVirtualizerEnabled = LVM_TRUE;
2721 tempDisabled = pContext->pBundledContext->bVirtualizerTempDisabled;
2724 if (pContext->pBundledContext->bVolumeEnabled == LVM_TRUE) {
2728 pContext->pBundledContext->NumberEffectsEnabled++;
2729 pContext->pBundledContext->bVolumeEnabled = LVM_TRUE;
2741 if (pContext->pBundledContext->bBassEnabled == LVM_FALSE) {
2745 pContext->pBundledContext->bBassEnabled = LVM_FALSE;
2748 if (pContext->pBundledContext->bEqualizerEnabled == LVM_FALSE) {
2752 pContext->pBundledContext->bEqualizerEnabled = LVM_FALSE;
2755 if (pContext->pBundledContext->bVirtualizerEnabled == LVM_FALSE) {
2759 pContext->pBundledContext->bVirtualizerEnabled = LVM_FALSE;
2762 if (pContext->pBundledContext->bVolumeEnabled == LVM_FALSE) {
2766 pContext->pBundledContext->bVolumeEnabled = LVM_FALSE;
2815 //pContext->pBundledContext->NumberEffectsEnabled,pContext->pBundledContext->NumberEffectsCalled,
2816 // pContext->pBundledContext->SamplesToExitCountBb,
2817 // pContext->pBundledContext->SamplesToExitCountVirt,
2818 // pContext->pBundledContext->SamplesToExitCountEq);
2839 if ((pContext->pBundledContext->bBassEnabled == LVM_FALSE)&&
2842 if(pContext->pBundledContext->SamplesToExitCountBb > 0){
2843 pContext->pBundledContext->SamplesToExitCountBb -= outBuffer->frameCount * 2; // STEREO
2845 // pContext->pBundledContext->SamplesToExitCountBb);
2847 if(pContext->pBundledContext->SamplesToExitCountBb <= 0) {
2849 pContext->pBundledContext->NumberEffectsEnabled--;
2853 if ((pContext->pBundledContext
2857 pContext->pBundledContext->NumberEffectsEnabled--;
2859 if ((pContext->pBundledContext->bEqualizerEnabled == LVM_FALSE)&&
2862 if(pContext->pBundledContext->SamplesToExitCountEq > 0){
2863 pContext->pBundledContext->SamplesToExitCountEq -= outBuffer->frameCount * 2; // STEREO
2865 // pContext->pBundledContext->SamplesToExitCountEq);
2867 if(pContext->pBundledContext->SamplesToExitCountEq <= 0) {
2869 pContext->pBundledContext->NumberEffectsEnabled--;
2873 if ((pContext->pBundledContext->bVirtualizerEnabled == LVM_FALSE)&&
2876 if(pContext->pBundledContext->SamplesToExitCountVirt > 0){
2877 pContext->pBundledContext->SamplesToExitCountVirt -= outBuffer->frameCount * 2;// STEREO
2879 // pContext->pBundledContext->SamplesToExitCountVirt);
2881 if(pContext->pBundledContext->SamplesToExitCountVirt <= 0) {
2883 pContext->pBundledContext->NumberEffectsEnabled--;
2889 pContext->pBundledContext->NumberEffectsCalled++;
2892 if(pContext->pBundledContext->NumberEffectsCalled ==
2893 pContext->pBundledContext->NumberEffectsEnabled){
2895 //pContext->pBundledContext->NumberEffectsEnabled,
2896 //pContext->pBundledContext->NumberEffectsCalled, pContext->EffectType);
2901 pContext->pBundledContext->NumberEffectsCalled = 0;
2914 //pContext->pBundledContext->NumberEffectsEnabled,
2915 //pContext->pBundledContext->NumberEffectsCalled, pContext->EffectType);
2964 // pContext->pBundledContext->NumberEffectsCalled = 0;
2967 // pContext->pBundledContext->NumberEffectsCalled,
2968 // pContext->pBundledContext->NumberEffectsEnabled);
3295 pContext->pBundledContext->nOutputDevice = (audio_devices_t) device;
3309 if (pContext->pBundledContext->bBassEnabled == LVM_TRUE) {
3314 pContext->pBundledContext->bBassTempDisabled = LVM_TRUE;
3322 if (pContext->pBundledContext->bBassEnabled == LVM_TRUE) {
3327 pContext->pBundledContext->bBassTempDisabled = LVM_FALSE;
3331 if (pContext->pBundledContext->nVirtualizerForcedDevice == AUDIO_DEVICE_NONE) {
3342 if (pContext->pBundledContext->bVirtualizerEnabled == LVM_TRUE) {
3347 pContext->pBundledContext->bVirtualizerTempDisabled = LVM_TRUE;
3355 if(pContext->pBundledContext->bVirtualizerEnabled == LVM_TRUE){
3360 pContext->pBundledContext->bVirtualizerTempDisabled = LVM_FALSE;
3412 //pContext->pBundledContext->SessionNo, pContext->pBundledContext->SessionId,
3422 LvmStatus =LVM_GetControlParameters(pContext->pBundledContext->hInstance,&ActiveParams);
3431 LvmStatus =LVM_SetControlParameters(pContext->pBundledContext->hInstance,&ActiveParams);