| 458 | }; |
| 459 | |
| 460 | SBSMSInterfaceSlidingImp :: 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 | |
| 497 | float SBSMSInterfaceSliding :: getStretch(float t) { return imp->getStretch(t); } |
| 498 | float SBSMSInterfaceSlidingImp :: getStretch(float t) |
nothing calls this directly
no test coverage detected