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

Method DrawTimer

Source/ScriptModule.cpp:491–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491void ScriptModule::DrawTimer(int lineNum, double startTime, double endTime, ofColor color, bool filled)
492{
493 ofVec2f linePos = mCodeEntry->GetLinePos(lineNum, false);
494 linePos.x += 11;
495 linePos.y += 10;
496 float t = (gTime - startTime) / (endTime - startTime);
497 if (t > 0 && t < 1)
498 {
499 const float kRadius = 5;
500 ofPushStyle();
501 if (filled)
502 ofSetColor(color);
503 else
504 ofSetColor(color * .5f);
505 ofNoFill();
506 ofCircle(linePos.x, linePos.y, kRadius);
507 if (filled)
508 ofFill();
509 ofCircle(linePos.x + sin(t * TWO_PI) * kRadius, linePos.y - cos(t * TWO_PI) * kRadius, 2);
510 ofPopStyle();
511 }
512}
513
514void ScriptModule::Poll()
515{

Callers

nothing calls this directly

Calls 7

ofPushStyleFunction · 0.85
ofSetColorFunction · 0.85
ofNoFillFunction · 0.85
ofCircleFunction · 0.85
ofFillFunction · 0.85
ofPopStyleFunction · 0.85
GetLinePosMethod · 0.80

Tested by

no test coverage detected