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

Method DrawPatchCables

Source/IDrawableModule.cpp:506–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506void IDrawableModule::DrawPatchCables(bool parentMinimized, bool inFront)
507{
508 if (mPinned)
509 ForcePosition();
510 for (auto source : mPatchCableSources)
511 {
512 ConnectionType type = source->GetConnectionType();
513 bool isHeld = false;
514 if (PatchCable::sActivePatchCable != nullptr)
515 isHeld = (PatchCable::sActivePatchCable->GetOwner() == source);
516 bool shouldDrawInFront = isHeld || (type != kConnectionType_Note && type != kConnectionType_Pulse && type != kConnectionType_Audio);
517 if (type == kConnectionType_Pulse)
518 {
519 for (auto const cable : source->GetPatchCables())
520 {
521 if (cable->GetTarget() != nullptr &&
522 dynamic_cast<IUIControl*>(cable->GetTarget()) != nullptr)
523 {
524 shouldDrawInFront = true;
525 break;
526 }
527 }
528 }
529 if ((inFront && !shouldDrawInFront) || (!inFront && shouldDrawInFront))
530 continue;
531
532 source->UpdatePosition(parentMinimized);
533 source->DrawCables(parentMinimized);
534 }
535}
536
537//static
538ofColor IDrawableModule::GetColor(ModuleCategory type)

Callers

nothing calls this directly

Calls 5

DrawCablesMethod · 0.80
GetConnectionTypeMethod · 0.45
GetOwnerMethod · 0.45
GetTargetMethod · 0.45
UpdatePositionMethod · 0.45

Tested by

no test coverage detected