| 567 | } |
| 568 | |
| 569 | void WaveClip::StretchLeftTo(double to) |
| 570 | { |
| 571 | const auto pet = GetPlayEndTime(); |
| 572 | if (to >= pet) |
| 573 | return; |
| 574 | const auto oldPlayDuration = pet - GetPlayStartTime(); |
| 575 | const auto newPlayDuration = pet - to; |
| 576 | const auto ratioChange = newPlayDuration / oldPlayDuration; |
| 577 | mSequenceOffset = pet - (pet - mSequenceOffset) * ratioChange; |
| 578 | mTrimLeft *= ratioChange; |
| 579 | mTrimRight *= ratioChange; |
| 580 | mClipStretchRatio *= ratioChange; |
| 581 | mEnvelope->SetOffset(mSequenceOffset); |
| 582 | mEnvelope->RescaleTimesBy(ratioChange); |
| 583 | StretchCutLines(ratioChange); |
| 584 | Observer::Publisher<StretchRatioChange>::Publish( |
| 585 | StretchRatioChange { GetStretchRatio() }); |
| 586 | } |
| 587 | |
| 588 | void WaveClip::StretchRightTo(double to) |
| 589 | { |
no test coverage detected