MCPcopy Create free account
hub / github.com/audeering/opensmile / myTick

Method myTick

src/core/dataSelector.cpp:537–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535*/
536
537eTickResult cDataSelector::myTick(long long t)
538{
539 if (dummyMode) return TICK_INACTIVE;
540
541 SMILE_IDBG(4,"tick # %i, processing value vector",t);
542
543 int framesWritten;
544
545 // we do not process in blocks using getNextMatrix because
546 // tmeta information would be only associated with the first vector in
547 // each matrix and all other frames would lack tmeta information
548 for (framesWritten = 0; framesWritten < MIN(blocksizeR_, blocksizeW_); framesWritten++) {
549 if (!writer_->checkWrite(1))
550 return framesWritten > 0 ? TICK_SUCCESS : TICK_DEST_NO_SPACE;
551
552 // get next frame from dataMemory
553 cVector *vec = reader_->getNextFrame();
554 if (vec == NULL)
555 return framesWritten > 0 ? TICK_SUCCESS : TICK_SOURCE_NOT_AVAIL;
556
557 if (vecO == NULL) vecO = new cVector(nElSel);
558 long i;
559
560 if (elementMode) {
561 if (selectionIsRange) {
562 long j=0;
563 for (i=0; i<vec->N; i++) {
564 if (idxSelected[i]) { vecO->data[j++] = vec->data[i]; }
565 }
566 } else {
567 for (i=0; i<nElSel; i++) {
568 vecO->data[i] = vec->data[mapping[i].eIdx];
569 }
570 }
571 } else {
572 int j; long n=0;
573 for (i=0; i<nFSel; i++) {
574 for (j=0; j<mapping[i].N; j++) {
575 vecO->data[n++] = vec->data[mapping[i].aIdx+j];
576 }
577 }
578 }
579
580 vecO->setTimeMeta(vec->tmeta);
581
582 // save to dataMemory
583 writer_->setNextFrame(vecO);
584 }
585
586 return framesWritten > 0 ? TICK_SUCCESS : TICK_INACTIVE;
587}
588
589
590cDataSelector::~cDataSelector()

Callers

nothing calls this directly

Calls 4

getNextFrameMethod · 0.80
setTimeMetaMethod · 0.80
setNextFrameMethod · 0.80
checkWriteMethod · 0.45

Tested by

no test coverage detected