MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / PlayCuePoint

Method PlayCuePoint

Source/SamplePlayer.cpp:416–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416void 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
433void SamplePlayer::DropdownClicked(DropdownList* list)
434{

Callers

nothing calls this directly

Calls 6

SetPlayPositionMethod · 0.80
StartSwitchMethod · 0.80
GetSampleRateRatioMethod · 0.45
ClearMethod · 0.45
StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected