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

Method OnClicked

Source/Looper.cpp:1032–1047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1030}
1031
1032void Looper::OnClicked(float x, float y, bool right)
1033{
1034 IDrawableModule::OnClicked(x, y, right);
1035
1036 if (x >= kBufferX + kBufferWidth / 3 && x < kBufferX + (kBufferWidth * 2) / 3 &&
1037 y >= kBufferY + kBufferHeight / 3 && y < kBufferY + (kBufferHeight * 2) / 3 &&
1038 mBufferTempo == TheTransport->GetTempo() &&
1039 gHoveredUIControl == nullptr)
1040 {
1041 ChannelBuffer grab(mLoopLength);
1042 grab.SetNumActiveChannels(mBuffer->NumActiveChannels());
1043 for (int ch = 0; ch < grab.NumActiveChannels(); ++ch)
1044 BufferCopy(grab.GetChannel(ch), mBuffer->GetChannel(ch), mLoopLength);
1045 TheSynth->GrabSample(&grab, "loop", false, mNumBars);
1046 }
1047}
1048
1049void Looper::ButtonClicked(ClickButton* button, double time)
1050{

Callers

nothing calls this directly

Calls 6

BufferCopyFunction · 0.85
SetNumActiveChannelsMethod · 0.80
NumActiveChannelsMethod · 0.80
GetChannelMethod · 0.80
GetTempoMethod · 0.45
GrabSampleMethod · 0.45

Tested by

no test coverage detected