| 492 | } |
| 493 | |
| 494 | void SamplePlayer::UpdateSample(Sample* sample, bool ownsSample) |
| 495 | { |
| 496 | Sample* oldSamplePtr = mSample; |
| 497 | bool ownedOldSample = mOwnsSample; |
| 498 | |
| 499 | float lengthSeconds = sample->LengthInSamples() / (gSampleRate * sample->GetSampleRateRatio()); |
| 500 | mCuePointStartSlider->SetExtents(0, lengthSeconds); |
| 501 | mCuePointLengthSlider->SetExtents(0, lengthSeconds); |
| 502 | |
| 503 | sample->SetPlayPosition(0); |
| 504 | sample->SetLooping(mLoop); |
| 505 | sample->SetRate(mSpeed); |
| 506 | mSample = sample; |
| 507 | mPlay = false; |
| 508 | mOwnsSample = ownsSample; |
| 509 | mZoomLevel = 1; |
| 510 | mZoomOffset = 0; |
| 511 | mRecordingLength = 0; |
| 512 | |
| 513 | mErrorString = ""; |
| 514 | |
| 515 | if (ownedOldSample) |
| 516 | delete oldSamplePtr; |
| 517 | |
| 518 | mIsLoadingSample = true; |
| 519 | } |
| 520 | |
| 521 | void SamplePlayer::ButtonClicked(ClickButton* button, double time) |
| 522 | { |
nothing calls this directly
no test coverage detected