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

Method IntSliderUpdated

Source/StepSequencer.cpp:845–866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843}
844
845void StepSequencer::IntSliderUpdated(IntSlider* slider, int oldVal, double time)
846{
847 if (slider == mNumMeasuresSlider)
848 {
849 mGrid->SetGrid(GetNumSteps(mStepInterval, mNumMeasures), mNumRows);
850 if (mNumMeasures > oldVal)
851 {
852 int newChunkCount = ceil(float(mNumMeasures) / oldVal);
853 int stepsPerChunk = GetNumSteps(mStepInterval, oldVal);
854 for (int chunk = 1; chunk < newChunkCount; ++chunk)
855 {
856 for (int col = 0; col < stepsPerChunk && col + stepsPerChunk * chunk < mGrid->GetCols(); ++col)
857 {
858 for (int row = 0; row < mGrid->GetRows(); ++row)
859 {
860 mGrid->SetVal(col + stepsPerChunk * chunk, row, mGrid->GetVal(col, row), false);
861 }
862 }
863 }
864 }
865 }
866}
867
868void StepSequencer::ButtonClicked(ClickButton* button, double time)
869{

Callers

nothing calls this directly

Calls 5

SetValMethod · 0.80
GetValMethod · 0.80
SetGridMethod · 0.45
GetColsMethod · 0.45
GetRowsMethod · 0.45

Tested by

no test coverage detected