MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / setModule

Method setModule

plugins/Cardinal/src/HostMIDI-CC.cpp:665–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663 }
664
665 void setModule(HostMIDICC* const module)
666 {
667 LedDisplaySeparator* hSeparators[6];
668 LedDisplaySeparator* vSeparators[3];
669 LedDisplayChoice* choices[3][6];
670
671 // Add vSeparators
672 for (int x = 0; x < 3; ++x)
673 {
674 vSeparators[x] = new LedDisplaySeparator;
675 vSeparators[x]->box.pos = Vec(box.size.x / 3 * (x+1), 0.0f);
676 vSeparators[x]->box.size = Vec(1.0f, box.size.y);
677 addChild(vSeparators[x]);
678 }
679
680 // Add hSeparators and choice widgets
681 for (int y = 0; y < 6; ++y)
682 {
683 hSeparators[y] = new LedDisplaySeparator;
684 hSeparators[y]->box.pos = Vec(0.0f, box.size.y / 6 * (y+1));
685 hSeparators[y]->box.size = Vec(box.size.x, 1.0f);
686 addChild(hSeparators[y]);
687
688 for (int x = 0; x < 3; ++x)
689 {
690 const int id = 6 * x + y;
691
692 switch (id)
693 {
694 case 16:
695 choices[x][y] = new CardinalLedDisplayChoice("Ch.press");
696 break;
697 case 17:
698 choices[x][y] = new CardinalLedDisplayChoice("Pbend");
699 break;
700 default:
701 choices[x][y] = new CardinalCcChoice(module, id);
702 break;
703 }
704
705 choices[x][y]->box.pos = Vec(box.size.x / 3 * x, box.size.y / 6 * y);
706 choices[x][y]->box.size = Vec(box.size.x / 3, box.size.y / 6);
707 addChild(choices[x][y]);
708 }
709 }
710 }
711};
712
713struct HostMIDICCWidget : ModuleWidgetWith14HP {

Callers 2

onActionMethod · 0.45
HostMIDICCWidgetMethod · 0.45

Calls 1

VecClass · 0.85

Tested by

no test coverage detected