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

Method ButtonClicked

Source/ControllingSong.cpp:250–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250void ControllingSong::ButtonClicked(ClickButton* button, double time)
251{
252 if (button == mNextSongButton)
253 mNeedNewSong = true;
254 if (button == mPhraseForwardButton || button == mPhraseBackButton)
255 {
256 int position = mSample.GetPlayPosition();
257 int jumpAmount = TheTransport->GetDuration(kInterval_4) / gInvSampleRateMs * mSample.GetSampleRateRatio();
258 if (button == mPhraseBackButton)
259 jumpAmount *= -1;
260 int newPosition = position + jumpAmount;
261 if (newPosition < 0)
262 newPosition = 0;
263 mSample.SetPlayPosition(newPosition);
264 }
265}
266
267void ControllingSong::CheckboxUpdated(Checkbox* checkbox, double time)
268{

Callers

nothing calls this directly

Calls 4

GetPlayPositionMethod · 0.80
GetDurationMethod · 0.80
SetPlayPositionMethod · 0.80
GetSampleRateRatioMethod · 0.45

Tested by

no test coverage detected