| 109 | } |
| 110 | |
| 111 | void GridSliders::OnGridButton(int x, int y, float velocity, IGridController* grid) |
| 112 | { |
| 113 | if (velocity > 0) |
| 114 | { |
| 115 | int sliderIndex, squareIndex, length; |
| 116 | if (mDirection == Direction::kVertical) |
| 117 | { |
| 118 | sliderIndex = x; |
| 119 | squareIndex = grid->NumRows() - y - 1; |
| 120 | length = mGridControlTarget->GetGridController()->NumRows(); |
| 121 | } |
| 122 | else |
| 123 | { |
| 124 | sliderIndex = y; |
| 125 | squareIndex = x; |
| 126 | length = mGridControlTarget->GetGridController()->NumCols(); |
| 127 | } |
| 128 | |
| 129 | if (sliderIndex < mControlCables.size() && mControlCables[sliderIndex]->GetTarget()) |
| 130 | { |
| 131 | float value = squareIndex / float(length - 1); |
| 132 | for (auto& cable : mControlCables[sliderIndex]->GetPatchCables()) |
| 133 | dynamic_cast<IUIControl*>(cable->GetTarget())->SetFromMidiCC(value, NextBufferTime(false), false); |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | void GridSliders::DrawModule() |
| 139 | { |
nothing calls this directly
no test coverage detected