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

Method OnClicked

Source/SamplePlayer.cpp:783–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781}
782
783void SamplePlayer::OnClicked(float x, float y, bool right)
784{
785 IDrawableModule::OnClicked(x, y, right);
786
787 if (right)
788 return;
789
790 if (mYoutubeSearchResults.size() > 0)
791 return;
792
793 if (y > 60 && y < mHeight - 20 && mSample != nullptr && gHoveredUIControl == nullptr)
794 {
795 mSwitchAndRamp.StartSwitch();
796 mCuePointSpeed = 1;
797 mStopOnNoteOff = false;
798 mPlay = true;
799 mAdsr.Clear();
800 mAdsr.Start(NextBufferTime(false), 1);
801 mSample->SetPlayPosition(int(GetPlayPositionForMouse(x)));
802 mScrubbingSample = true;
803
804 if (mSetCuePoint)
805 SetCuePointForX(x);
806 }
807}
808
809ChannelBuffer* SamplePlayer::GetCueSampleData(int cueIndex)
810{

Callers

nothing calls this directly

Calls 6

NextBufferTimeFunction · 0.85
sizeMethod · 0.80
StartSwitchMethod · 0.80
SetPlayPositionMethod · 0.80
ClearMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected