| 414 | } |
| 415 | |
| 416 | void SamplePlayer::PlayCuePoint(double time, int index, int velocity, float speedMult, float startOffsetSeconds) |
| 417 | { |
| 418 | if (mSample != nullptr) |
| 419 | { |
| 420 | float startSeconds, lengthSeconds, speed; |
| 421 | GetPlayInfoForPitch(index, startSeconds, lengthSeconds, speed, mStopOnNoteOff); |
| 422 | mSample->SetPlayPosition((startSeconds + startOffsetSeconds) * gSampleRate * mSample->GetSampleRateRatio()); |
| 423 | mCuePointSpeed = speed * speedMult; |
| 424 | mPlay = true; |
| 425 | mAdsr.Clear(); |
| 426 | mAdsr.Start(time, velocity / 127.0f); |
| 427 | if (lengthSeconds > 0) |
| 428 | mAdsr.Stop(time + lengthSeconds * 1000 / speed); |
| 429 | mSwitchAndRamp.StartSwitch(); |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | void SamplePlayer::DropdownClicked(DropdownList* list) |
| 434 | { |
nothing calls this directly
no test coverage detected