Lines Matching defs:pContext
119 int Equalizer_init(EqualizerContext *pContext);
120 int Equalizer_setConfig(EqualizerContext *pContext, effect_config_t *pConfig);
146 EqualizerContext *pContext = new EqualizerContext;
148 pContext->itfe = &gEqualizerInterface;
149 pContext->pEqualizer = NULL;
150 pContext->state = EQUALIZER_STATE_UNINITIALIZED;
152 ret = Equalizer_init(pContext);
155 delete pContext;
159 *pHandle = (effect_handle_t)pContext;
160 pContext->state = EQUALIZER_STATE_INITIALIZED;
163 pContext, AudioEqualizer::GetInstanceSize(kNumBands)+sizeof(EqualizerContext));
170 EqualizerContext * pContext = (EqualizerContext *)handle;
173 if (pContext == NULL) {
177 pContext->state = EQUALIZER_STATE_UNINITIALIZED;
178 pContext->pEqualizer->free();
179 delete pContext;
218 // pContext: effect engine context
226 int Equalizer_setConfig(EqualizerContext *pContext, effect_config_t *pConfig)
230 CHECK_ARG(pContext != NULL);
250 pContext->config = *pConfig;
252 pContext->pEqualizer->configure(channelCount,
255 pContext->adapter.configure(*pContext->pEqualizer, channelCount,
268 // pContext: effect engine context
276 void Equalizer_getConfig(EqualizerContext *pContext, effect_config_t *pConfig)
278 *pConfig = pContext->config;
289 // pContext: effect engine context
295 int Equalizer_init(EqualizerContext *pContext)
301 CHECK_ARG(pContext != NULL);
303 if (pContext->pEqualizer != NULL) {
304 pContext->pEqualizer->free();
307 pContext->config.inputCfg.accessMode = EFFECT_BUFFER_ACCESS_READ;
308 pContext->config.inputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
309 pContext->config.inputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
310 pContext->config.inputCfg.samplingRate = 44100;
311 pContext->config.inputCfg.bufferProvider.getBuffer = NULL;
312 pContext->config.inputCfg.bufferProvider.releaseBuffer = NULL;
313 pContext->config.inputCfg.bufferProvider.cookie = NULL;
314 pContext->config.inputCfg.mask = EFFECT_CONFIG_ALL;
315 pContext->config.outputCfg.accessMode = EFFECT_BUFFER_ACCESS_ACCUMULATE;
316 pContext->config.outputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
317 pContext->config.outputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
318 pContext->config.outputCfg.samplingRate = 44100;
319 pContext->config.outputCfg.bufferProvider.getBuffer = NULL;
320 pContext->config.outputCfg.bufferProvider.releaseBuffer = NULL;
321 pContext->config.outputCfg.bufferProvider.cookie = NULL;
322 pContext->config.outputCfg.mask = EFFECT_CONFIG_ALL;
324 pContext->pEqualizer = AudioEqualizer::CreateInstance(
333 pContext->pEqualizer->setFrequency(i, gFreqs[i]);
334 pContext->pEqualizer->setBandwidth(i, gBandwidths[i]);
337 pContext->pEqualizer->enable(true);
339 Equalizer_setConfig(pContext, &pContext->config);
606 android::EqualizerContext * pContext = (android::EqualizerContext *) self;
608 if (pContext == NULL) {
617 if (pContext->state == EQUALIZER_STATE_UNINITIALIZED) {
620 if (pContext->state == EQUALIZER_STATE_INITIALIZED) {
624 pContext->adapter.process(inBuffer->raw, outBuffer->raw, outBuffer->frameCount);
632 android::EqualizerContext * pContext = (android::EqualizerContext *) self;
635 if (pContext == NULL || pContext->state == EQUALIZER_STATE_UNINITIALIZED) {
639 android::AudioEqualizer * pEqualizer = pContext->pEqualizer;
648 *(int *) pReplyData = Equalizer_init(pContext);
655 *(int *) pReplyData = Equalizer_setConfig(pContext,
662 Equalizer_getConfig(pContext, (effect_config_t *) pCmdData);
665 Equalizer_setConfig(pContext, &pContext->config);
700 if (pContext->state != EQUALIZER_STATE_INITIALIZED) {
703 pContext->state = EQUALIZER_STATE_ACTIVE;
711 if (pContext->state != EQUALIZER_STATE_ACTIVE) {
714 pContext->state = EQUALIZER_STATE_INITIALIZED;
733 android::EqualizerContext * pContext = (android::EqualizerContext *) self;
735 if (pContext == NULL || pDescriptor == NULL) {