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

Method OnGridButton

Source/PlaySequencer.cpp:396–497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396void PlaySequencer::OnGridButton(int x, int y, float velocity, IGridController* grid)
397{
398 if (grid == mGridControlTarget->GetGridController())
399 {
400 bool press = velocity > 0;
401 if (x >= 0 && y >= 0)
402 {
403 if (press && y == 0 && x < 4)
404 mWrite = !mWrite;
405
406 if (press && y == 1 && x < 3)
407 mNoteRepeat = !mNoteRepeat;
408
409 if (press && y == 1 && x == 3)
410 mLinkColumns = !mLinkColumns;
411
412 if (press && y == 2)
413 {
414 int newNumMeasures = mNumMeasures;
415 if (x == 0)
416 newNumMeasures = 1;
417 if (x == 1)
418 newNumMeasures = 2;
419 if (x == 2)
420 newNumMeasures = 4;
421 if (x == 3)
422 newNumMeasures = 8;
423
424 if (newNumMeasures != mNumMeasures)
425 {
426 int oldNumMeasures = mNumMeasures;
427 mNumMeasures = newNumMeasures;
428 UpdateNumMeasures(oldNumMeasures);
429 }
430 }
431
432 if (x == 0 && y == 3)
433 mUseLightVelocity = press;
434 if (x == 1 && y == 3)
435 mUseMedVelocity = press;
436
437 if (x == 3 && y == 3)
438 mClearLane = press;
439
440 if (x == 2 && y == 3 && mClearLane)
441 mGrid->Clear();
442
443 if (x >= 4 && y == 0)
444 ButtonClicked(mSavedPatterns[x - 4].mStoreButton, NextBufferTime(false));
445 if (x >= 4 && y == 1)
446 ButtonClicked(mSavedPatterns[x - 4].mLoadButton, NextBufferTime(false));
447
448 if (y >= 4)
449 {
450 int pitch = x / 2 + (7 - y) * 4;
451 if (x % 2 == 0)
452 {
453 if (velocity > 0)

Callers

nothing calls this directly

Calls 6

NextBufferTimeFunction · 0.85
GetGridControllerMethod · 0.80
sizeMethod · 0.80
SetValMethod · 0.80
ClearMethod · 0.45
GetColsMethod · 0.45

Tested by

no test coverage detected