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

Method DrawModule

Source/TitleBar.cpp:335–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335void TitleBar::DrawModule()
336{
337 if (HiddenByZoom())
338 return;
339
340 ofSetColor(255, 255, 255);
341
342 ofPushStyle();
343 if (gHoveredModule == this && mLeftCornerHovered)
344 ofSetColor(ofColor::lerp(ofColor::black, ofColor::white, ofMap(sin(gTime / 1000 * PI * 2), -1, 1, .7f, .9f)));
345 DrawTextBold("bespoke", 2, 28, 34);
346#if BESPOKE_NIGHTLY && !BESPOKE_SUPPRESS_NIGHTLY_LABEL
347 DrawTextNormal("nightly", 90, 35, 8);
348#endif
349#if DEBUG
350 ofFill();
351 ofSetColor(0, 0, 0, 180);
352 ofRect(13, 12, 90, 17);
353 ofSetColor(255, 0, 0);
354 DrawTextBold("debug build", 17, 25, 17);
355#endif
356 ofPopStyle();
357
358 std::string info;
359 if (TheSynth->GetMoveModule())
360 info += " (moving module \"" + std::string(TheSynth->GetMoveModule()->Name()) + "\")";
361 if (IKeyboardFocusListener::GetActiveKeyboardFocus())
362 info += " (entering text)";
363
364 float pixelWidth = GetPixelWidth();
365
366 DrawTextRightJustify(info, pixelWidth - 140, 32);
367
368 mSaveLayoutButton->Draw();
369 mSaveStateButton->Draw();
370 mSaveStateAsButton->Draw();
371 mLoadStateButton->Draw();
372 mWriteAudioButton->Draw();
373 mLoadLayoutDropdown->Draw();
374 mResetLayoutButton->Draw();
375 if (TheSynth->IsAudioPaused())
376 mPlayPauseButton->SetDisplayStyle(ButtonDisplayStyle::kPlay);
377 else
378 mPlayPauseButton->SetDisplayStyle(ButtonDisplayStyle::kPause);
379 mPlayPauseButton->Draw();
380
381 float startX = 400;
382 float startY = 2;
383
384 if (pixelWidth < kDoubleHeightThreshold)
385 {
386 startX = 10;
387 startY += 16 * 2 + 4;
388 }
389
390 float x = startX;
391 float y = startY;
392 for (auto* spawnList : mSpawnLists.GetDropdowns())

Callers

nothing calls this directly

Calls 15

ofSetColorFunction · 0.85
ofPushStyleFunction · 0.85
ofMapFunction · 0.85
DrawTextBoldFunction · 0.85
DrawTextNormalFunction · 0.85
ofFillFunction · 0.85
ofRectFunction · 0.85
ofPopStyleFunction · 0.85
DrawTextRightJustifyFunction · 0.85
ofToStringFunction · 0.85
ofGetFrameRateFunction · 0.85
ofGetWidthFunction · 0.85

Tested by

no test coverage detected