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

Method DrawModule

Source/MidiController.cpp:990–1325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

988}
989
990void MidiController::DrawModule()
991{
992 if (gTime - mLastActivityTime > 0 && gTime - mLastActivityTime < 200)
993 {
994 ofPushStyle();
995 if (mLastActivityBound)
996 ofSetColor(0, 255, 0, 255 * (1 - (gTime - mLastActivityTime) / 200));
997 else
998 ofSetColor(255, 0, 0, 255 * (1 - (gTime - mLastActivityTime) / 200));
999 ofFill();
1000 ofRect(30 + gFont.GetStringWidth(Name(), 13), -11, 10, 10);
1001 ofPopStyle();
1002 }
1003
1004 if (!mIsConnected)
1005 {
1006 float xStart = 30 + gFont.GetStringWidth(Name(), 13);
1007 float yStart = -11;
1008
1009 ofPushStyle();
1010 ofSetColor(ofColor::red);
1011 ofLine(xStart, yStart, xStart + 10, yStart + 10);
1012 ofLine(xStart + 10, yStart, xStart, yStart + 10);
1013 ofPopStyle();
1014 }
1015
1016 if (TheSynth->GetLastClickedModule() == this)
1017 {
1018 for (auto i = mListeners[mControllerPage].begin(); i != mListeners[mControllerPage].end(); ++i)
1019 DrawConnection(dynamic_cast<IDrawableModule*>(*i));
1020 }
1021
1022 if (Minimized() || IsVisible() == false)
1023 return;
1024
1025 if (!mHasCreatedConnectionUIControls)
1026 {
1027 int i = 0;
1028 for (UIControlConnection* connection : mConnections)
1029 {
1030 connection->CreateUIControls(i);
1031 ++i;
1032 }
1033 mHasCreatedConnectionUIControls = true;
1034 }
1035
1036 mControllerList->Draw();
1037 mMappingDisplayModeSelector->Draw();
1038 mBindCheckbox->Draw();
1039 mPageSelector->Draw();
1040 //mDrawCablesCheckbox->Draw();
1041 mLayoutFileDropdown->SetShowing(mMappingDisplayMode == kLayout);
1042 mLayoutFileDropdown->Draw();
1043 mOscInPortEntry->SetShowing(mDeviceIn == "osccontroller" && mMappingDisplayMode == kLayout);
1044 mOscInPortEntry->Draw();
1045 mMonomeDeviceDropdown->SetShowing(mDeviceIn == "monome" && mMappingDisplayMode == kLayout);
1046 mMonomeDeviceDropdown->Draw();
1047

Callers

nothing calls this directly

Calls 15

ofPushStyleFunction · 0.85
ofSetColorFunction · 0.85
ofFillFunction · 0.85
ofRectFunction · 0.85
ofPopStyleFunction · 0.85
ofLineFunction · 0.85
DrawTextNormalFunction · 0.85
ofNoFillFunction · 0.85
ofClampFunction · 0.85
ofLerpFunction · 0.85
ofCircleFunction · 0.85
GetStringWidthMethod · 0.80

Tested by

no test coverage detected