| 584 | } |
| 585 | |
| 586 | void setModule(HostMIDIGate* const module) |
| 587 | { |
| 588 | LedDisplaySeparator* hSeparators[6]; |
| 589 | LedDisplaySeparator* vSeparators[3]; |
| 590 | LedDisplayChoice* choices[3][6]; |
| 591 | |
| 592 | // Add vSeparators |
| 593 | for (int x = 0; x < 3; ++x) |
| 594 | { |
| 595 | vSeparators[x] = new LedDisplaySeparator; |
| 596 | vSeparators[x]->box.pos = Vec(box.size.x / 3 * (x+1), 0.0f); |
| 597 | vSeparators[x]->box.size = Vec(1.0f, box.size.y); |
| 598 | addChild(vSeparators[x]); |
| 599 | } |
| 600 | |
| 601 | // Add hSeparators and choice widgets |
| 602 | for (int y = 0; y < 6; ++y) |
| 603 | { |
| 604 | hSeparators[y] = new LedDisplaySeparator; |
| 605 | hSeparators[y]->box.pos = Vec(0.0f, box.size.y / 6 * (y+1)); |
| 606 | hSeparators[y]->box.size = Vec(box.size.x, 1.0f); |
| 607 | addChild(hSeparators[y]); |
| 608 | |
| 609 | for (int x = 0; x < 3; ++x) |
| 610 | { |
| 611 | const int id = 6 * x + y; |
| 612 | |
| 613 | choices[x][y] = new CardinalNoteChoice(module, id); |
| 614 | choices[x][y]->box.pos = Vec(box.size.x / 3 * x, box.size.y / 6 * y); |
| 615 | choices[x][y]->box.size = Vec(box.size.x / 3, box.size.y / 6); |
| 616 | addChild(choices[x][y]); |
| 617 | } |
| 618 | } |
| 619 | } |
| 620 | }; |
| 621 | |
| 622 | struct HostMIDIGateWidget : ModuleWidgetWith14HP { |