Lines Matching refs:pContext

116 int Equalizer_init(EqualizerContext *pContext);
117 int Equalizer_setConfig(EqualizerContext *pContext, effect_config_t *pConfig);
143 EqualizerContext *pContext = new EqualizerContext;
145 pContext->itfe = &gEqualizerInterface;
146 pContext->pEqualizer = NULL;
147 pContext->state = EQUALIZER_STATE_UNINITIALIZED;
149 ret = Equalizer_init(pContext);
152 delete pContext;
156 *pHandle = (effect_handle_t)pContext;
157 pContext->state = EQUALIZER_STATE_INITIALIZED;
160 pContext, AudioEqualizer::GetInstanceSize(kNumBands)+sizeof(EqualizerContext));
167 EqualizerContext * pContext = (EqualizerContext *)handle;
170 if (pContext == NULL) {
174 pContext->state = EQUALIZER_STATE_UNINITIALIZED;
175 pContext->pEqualizer->free();
176 delete pContext;
215 // pContext: effect engine context
223 int Equalizer_setConfig(EqualizerContext *pContext, effect_config_t *pConfig)
227 CHECK_ARG(pContext != NULL);
247 pContext->config = *pConfig;
249 pContext->pEqualizer->configure(channelCount,
252 pContext->adapter.configure(*pContext->pEqualizer, channelCount,
265 // pContext: effect engine context
273 void Equalizer_getConfig(EqualizerContext *pContext, effect_config_t *pConfig)
275 *pConfig = pContext->config;
286 // pContext: effect engine context
292 int Equalizer_init(EqualizerContext *pContext)
298 CHECK_ARG(pContext != NULL);
300 if (pContext->pEqualizer != NULL) {
301 pContext->pEqualizer->free();
304 pContext->config.inputCfg.accessMode = EFFECT_BUFFER_ACCESS_READ;
305 pContext->config.inputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
306 pContext->config.inputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
307 pContext->config.inputCfg.samplingRate = 44100;
308 pContext->config.inputCfg.bufferProvider.getBuffer = NULL;
309 pContext->config.inputCfg.bufferProvider.releaseBuffer = NULL;
310 pContext->config.inputCfg.bufferProvider.cookie = NULL;
311 pContext->config.inputCfg.mask = EFFECT_CONFIG_ALL;
312 pContext->config.outputCfg.accessMode = EFFECT_BUFFER_ACCESS_ACCUMULATE;
313 pContext->config.outputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
314 pContext->config.outputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
315 pContext->config.outputCfg.samplingRate = 44100;
316 pContext->config.outputCfg.bufferProvider.getBuffer = NULL;
317 pContext->config.outputCfg.bufferProvider.releaseBuffer = NULL;
318 pContext->config.outputCfg.bufferProvider.cookie = NULL;
319 pContext->config.outputCfg.mask = EFFECT_CONFIG_ALL;
321 pContext->pEqualizer = AudioEqualizer::CreateInstance(
330 pContext->pEqualizer->setFrequency(i, gFreqs[i]);
331 pContext->pEqualizer->setBandwidth(i, gBandwidths[i]);
334 pContext->pEqualizer->enable(true);
336 Equalizer_setConfig(pContext, &pContext->config);
603 android::EqualizerContext * pContext = (android::EqualizerContext *) self;
605 if (pContext == NULL) {
614 if (pContext->state == EQUALIZER_STATE_UNINITIALIZED) {
617 if (pContext->state == EQUALIZER_STATE_INITIALIZED) {
621 pContext->adapter.process(inBuffer->raw, outBuffer->raw, outBuffer->frameCount);
629 android::EqualizerContext * pContext = (android::EqualizerContext *) self;
632 if (pContext == NULL || pContext->state == EQUALIZER_STATE_UNINITIALIZED) {
636 android::AudioEqualizer * pEqualizer = pContext->pEqualizer;
645 *(int *) pReplyData = Equalizer_init(pContext);
652 *(int *) pReplyData = Equalizer_setConfig(pContext,
659 Equalizer_getConfig(pContext, (effect_config_t *) pCmdData);
662 Equalizer_setConfig(pContext, &pContext->config);
697 if (pContext->state != EQUALIZER_STATE_INITIALIZED) {
700 pContext->state = EQUALIZER_STATE_ACTIVE;
708 if (pContext->state != EQUALIZER_STATE_ACTIVE) {
711 pContext->state = EQUALIZER_STATE_INITIALIZED;
730 android::EqualizerContext * pContext = (android::EqualizerContext *) self;
732 if (pContext == NULL || pDescriptor == NULL) {