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

Method GetSpawnableModules

Source/ModuleFactory.cpp:550–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548}
549
550std::vector<ModuleFactory::Spawnable> ModuleFactory::GetSpawnableModules(ModuleCategory moduleCategory)
551{
552 std::vector<ModuleFactory::Spawnable> modules{};
553 for (auto iter = mFactoryMap.begin(); iter != mFactoryMap.end(); ++iter)
554 {
555 if (iter->second.mCategory == moduleCategory &&
556 (!iter->second.mIsHidden || gShowDevModules))
557 {
558 ModuleFactory::Spawnable spawnable{};
559 spawnable.mLabel = iter->first;
560 modules.push_back(spawnable);
561 }
562 }
563
564 if (moduleCategory == kModuleCategory_Audio)
565 {
566 std::vector<std::string> effects = TheSynth->GetEffectFactory()->GetSpawnableEffects();
567 for (auto effect : effects)
568 {
569 ModuleFactory::Spawnable spawnable{};
570 spawnable.mLabel = effect;
571 spawnable.mDecorator = kEffectChainSuffix;
572 spawnable.mSpawnMethod = SpawnMethod::EffectChain;
573 modules.push_back(spawnable);
574 }
575 }
576
577 std::sort(modules.begin(), modules.end(), Spawnable::CompareAlphabetical);
578 return modules;
579}
580
581namespace
582{

Callers 3

SetModuleFactoryMethod · 0.80
UpdateDisplayMethod · 0.80
ButtonClickedMethod · 0.80

Calls 6

CheckHeldKeysMatchFunction · 0.85
GetAvailableVSTsFunction · 0.85
SortByLastUsedFunction · 0.85
GetSpawnableEffectsMethod · 0.80
GetEffectFactoryMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected