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

Method DrawRoutingDisplay

Source/Push2Control.cpp:937–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

935}
936
937void Push2Control::DrawRoutingDisplay()
938{
939 int topRowLedColors[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
940 int bottomRowLedColors[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
941 for (int i = 0; i < mRoutingInputModules.size(); ++i)
942 {
943 ofPushMatrix();
944 ofPushStyle();
945
946 ofSetColor(mRoutingInputModules[i].mConnectionColor);
947 ofLine(kColumnSpacing * (i + .5f), 37, kColumnSpacing * .5f, 60);
948
949 ofClipWindow(kColumnSpacing * i, 0, kColumnSpacing, ableton::Push2DisplayBitmap::kHeight * kPixelRatio, true);
950
951 float x;
952 float y;
953 mRoutingInputModules[i].mModule->GetPosition(x, y, true);
954 mRoutingInputModules[i].mModule->SetPosition(3 + kColumnSpacing * i, 12);
955 float titleBarHeight;
956 float highlight;
957 mRoutingInputModules[i].mModule->DrawFrame(kColumnSpacing - 14, 25, true, titleBarHeight, highlight);
958 mRoutingInputModules[i].mModule->SetPosition(x, y);
959
960 if (i >= 0 && i < 8)
961 topRowLedColors[i] = GetPadColorForType(mRoutingInputModules[i].mModule->GetModuleCategory(), true);
962
963 ofPopMatrix();
964 ofPopStyle();
965 }
966
967 for (int i = 0; i < mRoutingOutputModules.size(); ++i)
968 {
969 ofPushMatrix();
970 ofPushStyle();
971
972 ofSetColor(mRoutingOutputModules[i].mConnectionColor);
973 ofLine(kColumnSpacing * .5f, 97, kColumnSpacing * (i + .5f), 120);
974
975 ofClipWindow(kColumnSpacing * i, 0, kColumnSpacing, ableton::Push2DisplayBitmap::kHeight * kPixelRatio, true);
976
977 float x;
978 float y;
979 mRoutingOutputModules[i].mModule->GetPosition(x, y, true);
980 mRoutingOutputModules[i].mModule->SetPosition(3 + kColumnSpacing * i, 132);
981 float titleBarHeight;
982 float highlight;
983 mRoutingOutputModules[i].mModule->DrawFrame(kColumnSpacing - 14, 25, true, titleBarHeight, highlight);
984 mRoutingOutputModules[i].mModule->SetPosition(x, y);
985
986 if (i >= 0 && i < 8)
987 bottomRowLedColors[i] = GetPadColorForType(mRoutingOutputModules[i].mModule->GetModuleCategory(), true);
988
989 ofPopMatrix();
990 ofPopStyle();
991 }
992
993 {
994 ofPushMatrix();

Callers

nothing calls this directly

Calls 12

ofPushMatrixFunction · 0.85
ofPushStyleFunction · 0.85
ofSetColorFunction · 0.85
ofLineFunction · 0.85
ofClipWindowFunction · 0.85
ofPopMatrixFunction · 0.85
ofPopStyleFunction · 0.85
sizeMethod · 0.80
DrawFrameMethod · 0.80
GetPositionMethod · 0.45
SetPositionMethod · 0.45
GetModuleCategoryMethod · 0.45

Tested by

no test coverage detected