MCPcopy Create free account
hub / github.com/audacity/audacity / SBSMSInterfaceSlidingImp

Method SBSMSInterfaceSlidingImp

lib-src/libsbsms/src/slide.cpp:460–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458};
459
460SBSMSInterfaceSlidingImp :: SBSMSInterfaceSlidingImp(Slide *stretchSlide,
461 Slide *pitchSlide,
462 bool bPitchReferenceInput,
463 const SampleCountType &samplesToInput,
464 long preSamples,
465 SBSMSQuality *quality)
466{
467 this->stretchSlide = stretchSlide;
468 this->pitchSlide = pitchSlide;
469 this->bPitchReferenceInput = bPitchReferenceInput;
470 this->samplesToInput = samplesToInput;
471 this->preSamples = preSamples;
472 this->totalStretch = stretchSlide->getTotalStretch();
473 this->samplesToOutput = (SampleCountType)((float)samplesToInput * totalStretch);
474 stretchScale = 1.0f;
475
476 if(quality) {
477 SampleCountType samplesIn = 0;
478 SampleCountType samplesOut = 0;
479 float outFrameSizefloat = 0.0f;
480 float stretch = 1.0f;
481 int inFrameSize = quality->getFrameSize();
482 while(samplesIn < samplesToInput) {
483 float t = (float)samplesIn / (float)samplesToInput;
484 float t1 =(float)(samplesIn + inFrameSize) / (float)samplesToInput;
485 stretch = stretchSlide->getMeanStretch(t,t1);
486 outFrameSizefloat += stretch * inFrameSize;
487 int outFrameSize = (int) outFrameSizefloat;
488 outFrameSizefloat -= (float) outFrameSize;
489 samplesIn += inFrameSize;
490 samplesOut += outFrameSize;
491 }
492 SampleCountType samplesOutputed = samplesOut - lrintf(stretch * (samplesIn - samplesToInput));
493 stretchScale = (float)samplesToOutput / (float)samplesOutputed;
494 }
495}
496
497float SBSMSInterfaceSliding :: getStretch(float t) { return imp->getStretch(t); }
498float SBSMSInterfaceSlidingImp :: getStretch(float t)

Callers

nothing calls this directly

Calls 3

lrintfFunction · 0.70
getTotalStretchMethod · 0.45
getMeanStretchMethod · 0.45

Tested by

no test coverage detected