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

Method GetLFO

Source/FloatSliderLFOControl.cpp:519–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519FloatSliderLFOControl* LFOPool::GetLFO(FloatSlider* owner)
520{
521 int index = sNextLFOIndex;
522 for (int i = 0; i < LFO_POOL_SIZE; ++i) //search for the next one that isn't enabled, but only one loop around
523 {
524 if (!sLFOPool[index]->IsEnabled() && !sLFOPool[index]->IsPinned())
525 break; //found a disabled one
526 index = (index + 1) % LFO_POOL_SIZE;
527 }
528 sNextLFOIndex = (index + 1) % LFO_POOL_SIZE;
529 if (sLFOPool[index]->GetOwner())
530 sLFOPool[index]->GetOwner()->SetLFO(nullptr); //revoke LFO
531 sLFOPool[index]->RandomizeSettings();
532 sLFOPool[index]->SetOwner(owner);
533 return sLFOPool[index];
534}
535
536namespace
537{

Callers

nothing calls this directly

Calls 6

RandomizeSettingsMethod · 0.80
IsEnabledMethod · 0.45
IsPinnedMethod · 0.45
GetOwnerMethod · 0.45
SetLFOMethod · 0.45
SetOwnerMethod · 0.45

Tested by

no test coverage detected