Lines Matching defs:this
5 * you may not use this file except in compliance with the License.
87 * @param this : pointer to Control PU
93 static pico_status_t ctrlInitialize(register picodata_ProcessingUnit this, picoos_int32 resetMode) {
98 if (NULL == this || NULL == this->subObj) {
101 ctrl = (ctrl_subobj_t *) this->subObj;
116 picoos_emRaiseException(this->common->em,status,NULL,(picoos_char*)"problem (re-)initializing the engine");
124 * @param this : pointer to Control PU
126 * @param bytesOutput : number of bytes produced during this step (output)
133 static picodata_step_result_t ctrlStep(register picodata_ProcessingUnit this,
140 register ctrl_subobj_t * ctrl = (ctrl_subobj_t *) this->subObj;
230 * @param this : pointer to Control PU
236 static pico_status_t ctrlTerminate(register picodata_ProcessingUnit this) {
240 if (NULL == this || NULL == this->subObj) {
243 ctrl = (ctrl_subobj_t *) this->subObj;
256 * @param this : pointer to Control PU
262 static pico_status_t ctrlSubObjDeallocate(register picodata_ProcessingUnit this,
267 if (NULL == this || NULL == this->subObj) {
270 ctrl = (ctrl_subobj_t *) this->subObj;
271 mm = mm; /* fix warning "var not used in this function"*/
274 picodata_disposeProcessingUnit(this->common->mm,&ctrl->procUnit[i]);
275 picodata_disposeCharBuffer(this->common->mm, &ctrl->procCbOut[i]);
278 picoos_deallocate(this->common->mm, (void *) &this->subObj);
285 * @param this : pointer to Control PU
295 static pico_status_t ctrlAddPU(register picodata_ProcessingUnit this,
304 if (this == NULL) {
307 ctrl = (ctrl_subobj_t *) this->subObj;
313 PICODBG_DEBUG(("taking cbIn of this because adding first pu"));
314 cbIn = this->cbIn;
320 PICODBG_DEBUG(("taking cbOut of this because adding last pu"));
321 ctrl->procCbOut[newPU] = this->cbOut;
325 ctrl->procCbOut[newPU] = picodata_newCharBuffer(this->common->mm,
326 this->common,bufSize);
339 ctrl->procUnit[newPU] = picotok_newTokenizeUnit(this->common->mm,
340 this->common, cbIn, ctrl->procCbOut[newPU], this->voice);
344 ctrl->procUnit[newPU] = picopr_newPreprocUnit(this->common->mm,
345 this->common, cbIn, ctrl->procCbOut[newPU], this->voice);
349 ctrl->procUnit[newPU] = picowa_newWordAnaUnit(this->common->mm,
350 this->common, cbIn, ctrl->procCbOut[newPU], this->voice);
354 ctrl->procUnit[newPU] = picosa_newSentAnaUnit(this->common->mm,
355 this->common, cbIn, ctrl->procCbOut[newPU], this->voice);
359 ctrl->procUnit[newPU] = picoacph_newAccPhrUnit(this->common->mm,
360 this->common, cbIn, ctrl->procCbOut[newPU], this->voice);
364 ctrl->procUnit[newPU] = picospho_newSentPhoUnit(this->common->mm,
365 this->common, cbIn, ctrl->procCbOut[newPU], this->voice);
369 ctrl->procUnit[newPU] = picopam_newPamUnit(this->common->mm,
370 this->common, cbIn, ctrl->procCbOut[newPU], this->voice);
374 ctrl->procUnit[newPU] = picocep_newCepUnit(this->common->mm,
375 this->common, cbIn, ctrl->procCbOut[newPU], this->voice);
380 ctrl->procUnit[newPU] = picosink_newSinkUnit(this->common->mm,
381 this->common, cbIn, ctrl->procCbOut[newPU], this->voice);
386 ctrl->procUnit[newPU] = picosig_newSigUnit(this->common->mm,
387 this->common, cbIn, ctrl->procCbOut[newPU], this->voice);
391 this->common->mm, this->common, cbIn,
392 ctrl->procCbOut[newPU], this->voice);
396 picodata_disposeCharBuffer(this->common->mm,&ctrl->procCbOut[newPU]);
405 picodata_ProcessingUnit * this);
425 picodata_ProcessingUnit this = picodata_newProcessingUnit(mm, common, cbIn,
427 if (this == NULL) {
431 this->initialize = ctrlInitialize;
432 this->step = ctrlStep;
433 this->terminate = ctrlTerminate;
434 this->subDeallocate = ctrlSubObjDeallocate;
436 this->subObj = picoos_allocate(mm, sizeof(ctrl_subobj_t));
437 if (this->subObj == NULL) {
438 picoos_deallocate(mm, (void **)(void*)&this);
442 ctrl = (ctrl_subobj_t *) this->subObj;
452 (PICO_OK == ctrlAddPU(this,PICODATA_PUTYPE_TOK, FALSE, /*last*/FALSE)) &&
453 (PICO_OK == ctrlAddPU(this
454 (PICO_OK == ctrlAddPU(this,PICODATA_PUTYPE_WA, FALSE, FALSE)) &&
455 (PICO_OK == ctrlAddPU(this,PICODATA_PUTYPE_SA, FALSE, FALSE)) &&
456 (PICO_OK == ctrlAddPU(this,PICODATA_PUTYPE_ACPH, FALSE, FALSE)) &&
457 (PICO_OK == ctrlAddPU(this,PICODATA_PUTYPE_SPHO, FALSE, FALSE)) &&
458 (PICO_OK == ctrlAddPU(this,PICODATA_PUTYPE_PAM, FALSE, FALSE)) &&
459 (PICO_OK == ctrlAddPU(this,PICODATA_PUTYPE_CEP, FALSE, FALSE)) &&
460 (PICO_OK == ctrlAddPU(this,PICODATA_PUTYPE_SIG, FALSE, TRUE))
467 return this;
469 picoctrl_disposeControl(this->common->mm,&this);
478 * @param this : pointer to Control PU
485 picodata_ProcessingUnit * this)
487 picodata_disposeProcessingUnit(mm, this);
518 * @param this : the engine object
524 pico_status_t picoctrl_engReset(picoctrl_Engine this, picoos_int32 resetMode)
528 if (NULL == this) {
531 picoos_emReset(this->common->em);
533 status = this->control->terminate(this->control);
535 status = this->control->initialize(this->control, resetMode);
538 status = picodata_cbReset(this->cbIn);
541 status = picodata_cbReset(this->cbOut);
544 picoos_emRaiseException(this->common->em,status,NULL,(picoos_char*) "problem resetting engine");
551 * @param this : the engine object
553 * @return non-zero if 'this' is a valid engine handle
558 picoos_int16 picoctrl_isValidEngineHandle(picoctrl_Engine this)
560 return (this != NULL) && CHECK_MAGIC_NUMBER(this);
565 * @param mm : memory manager to be used for this engine
566 * @param rm : resource manager to be used for this engine
567 * @param voiceName : voice definition to be used for this engine
583 picoctrl_Engine this = (picoctrl_Engine) picoos_allocate(mm, sizeof(*this));
587 done = (NULL != this);
590 this->magic = 0;
591 this->common = NULL;
592 this->voice = NULL;
593 this->control = NULL;
594 this->cbIn = NULL;
595 this->cbOut = NULL;
597 this->raw_mem = picoos_allocate(mm, PICOCTRL_DEFAULT_ENGINE_SIZE);
598 if (NULL == this->raw_mem) {
604 engMM = picoos_newMemoryManager(this->raw_mem, PICOCTRL_DEFAULT_ENGINE_SIZE,
609 this->common = picoos_newCommon(engMM);
611 done = (NULL != this->common) && (NULL != engEM);
614 this->common->mm = engMM;
615 this->common->em = engEM;
617 done = (PICO_OK == picorsrc_createVoice(rm,voiceName,&(this->voice)));
622 this->cbIn = picodata_newCharBuffer(this->common->mm,
623 this->common, bSize);
626 this->cbOut = picodata_newCharBuffer(this->common->mm,
627 this->common, bSize);
629 PICODBG_DEBUG(("cbOut has address %i", (picoos_uint32) this->cbOut));
632 this->control = picoctrl_newControl(this->common->mm, this->common,
633 this->cbIn, this->cbOut, this->voice);
634 done = (NULL != this->cbIn) && (NULL != this->cbOut)
635 && (NULL != this->control);
638 SET_MAGIC_NUMBER(this);
640 if (NULL != this) {
641 if (NULL != this->voice) {
642 picorsrc_releaseVoice(rm,&(this->voice));
644 if(NULL != this->raw_mem) {
645 picoos_deallocate(mm,&(this->raw_mem));
647 picoos_deallocate(mm,(void *)&this);
650 return this;
657 * @param this : handle of the engine to dispose
664 picoctrl_Engine * this)
666 if (NULL != (*this)) {
667 if (NULL != (*this)->voice) {
668 picorsrc_releaseVoice(rm,&((*this)->voice));
670 if(NULL != (*this)->control) {
671 picoctrl_disposeControl((*this)->common->mm,&((*this)->control));
673 if(NULL != (*this)->raw_mem) {
674 picoos_deallocate(mm,&((*this)->raw_mem));
676 (*this)->magic ^= 0xFFFEFDFC;
677 picoos_deallocate(mm,(void **)this);
683 * @param this : handle of the engine
689 picoctrl_Engine this
692 picoos_emReset(this->common->em);
697 * @param this : handle of the engine
704 picoos_Common picoctrl_engGetCommon(picoctrl_Engine this) {
705 if (NULL == this) {
708 return this->common;
714 * @param this : handle of the engine
723 pico_status_t picoctrl_engFeedText(picoctrl_Engine this,
726 if (NULL == this) {
731 while ((*bytesPut < textSize) && (PICO_OK == picodata_cbPutCh(this->cbIn, text[*bytesPut]))) {
740 * @param this : handle of the engine
750 picoctrl_Engine this,
758 if (NULL == this) {
762 stepResult = this->control->step(this->control,/* mode */0,&ui);
765 rv = picodata_cbGetSpeechData(this->cbOut, (picoos_uint8 *)buffer,
796 * @param this : handle of the engine
803 picoctrl_Engine this
807 if (NULL == this || NULL == this->control->subObj) {
810 ctrl = (ctrl_subobj_t *) ((*this).control->subObj);
816 * @param this : handle of the engine
824 picoctrl_Engine this
828 if (NULL == this || NULL == this->control->subObj) {
831 ctrl = (ctrl_subobj_t *) ((*this).control->subObj);