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

Method DrawModuleUnclipped

Source/ScriptModule.cpp:369–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369void ScriptModule::DrawModuleUnclipped()
370{
371 if (Minimized() || IsVisible() == false)
372 return;
373
374 mCodeEntry->RenderOverlay();
375
376 ofPushStyle();
377 if (mDrawDebug)
378 {
379 std::string debugText = mLastRunLiteralCode;
380
381 for (size_t i = 0; i < mScheduledNoteOutput.size(); ++i)
382 {
383 if (mScheduledNoteOutput[i].time != -1 &&
384 gTime + 50 < mScheduledNoteOutput[i].time)
385 debugText += "\nP:" + ofToString(mScheduledNoteOutput[i].pitch) + " V:" + ofToString(mScheduledNoteOutput[i].velocity) + ", " + ofToString(mScheduledNoteOutput[i].time) + " " + ofToString(mScheduledNoteOutput[i].startTime) + ", line:" + ofToString(mScheduledNoteOutput[i].lineNum);
386 }
387
388 for (size_t i = 0; i < mScheduledMethodCall.size(); ++i)
389 {
390 if (mScheduledMethodCall[i].time != -1 &&
391 gTime + 50 < mScheduledMethodCall[i].time)
392 debugText += "\n" + mScheduledMethodCall[i].method + ", " + ofToString(mScheduledMethodCall[i].time) + " " + ofToString(mScheduledMethodCall[i].startTime) + " " + ofToString(mScheduledMethodCall[i].lineNum);
393 }
394
395 for (size_t i = 0; i < mScheduledUIControlValue.size(); ++i)
396 {
397 if (mScheduledUIControlValue[i].time != -1 &&
398 gTime + 50 < mScheduledUIControlValue[i].time)
399 debugText += "\n" + std::string(mScheduledUIControlValue[i].control->Name()) + ": " + ofToString(mScheduledUIControlValue[i].value) + ", " + ofToString(mScheduledUIControlValue[i].time) + " " + ofToString(mScheduledUIControlValue[i].startTime) + " " + ofToString(mScheduledUIControlValue[i].lineNum);
400 }
401
402 std::string lineNumbers = "";
403 std::vector<std::string> lines = ofSplitString(mLastRunLiteralCode, "\n");
404 for (size_t i = 0; i < lines.size(); ++i)
405 {
406 lineNumbers += ofToString(i + 1) + "\n";
407 }
408
409 ofSetColor(100, 100, 100);
410 DrawTextNormal(lineNumbers, mWidth + 5, 0);
411 ofSetColor(255, 255, 255);
412 DrawTextNormal(debugText, mWidth + 30, 0);
413 }
414
415 for (size_t i = 0; i < mUIControlModifications.size(); ++i)
416 {
417 if (mUIControlModifications[i].time == -1)
418 continue;
419
420 float fadeMs = 200;
421 if (gTime - mUIControlModifications[i].time >= 0 && gTime - mUIControlModifications[i].time < fadeMs)
422 {
423 ofSetColor(IDrawableModule::GetColor(kModuleCategory_Modulator), 100 * (1 - (gTime - mUIControlModifications[i].time) / fadeMs));
424
425 ofVec2f linePos = mCodeEntry->GetLinePos(mUIControlModifications[i].lineNum, false);
426

Callers

nothing calls this directly

Calls 15

ofPushStyleFunction · 0.85
ofToStringFunction · 0.85
ofSplitStringFunction · 0.85
ofSetColorFunction · 0.85
DrawTextNormalFunction · 0.85
ofPushMatrixFunction · 0.85
ofTranslateFunction · 0.85
ofSetLineWidthFunction · 0.85
ofLineFunction · 0.85
ofPopMatrixFunction · 0.85
ofFillFunction · 0.85
ofClampFunction · 0.85

Tested by

no test coverage detected