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

Method GetPrefabs

Source/ModuleFactory.cpp:747–764  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

745
746//static
747void ModuleFactory::GetPrefabs(std::vector<ModuleFactory::Spawnable>& prefabs)
748{
749 using namespace juce;
750 File dir(ofToDataPath("prefabs"));
751 Array<File> files;
752 dir.findChildFiles(files, File::findFiles, false);
753 for (auto file : files)
754 {
755 if (file.getFileExtension() == ".pfb")
756 {
757 ModuleFactory::Spawnable spawnable;
758 spawnable.mLabel = file.getFileName().toStdString();
759 spawnable.mDecorator = kPrefabSuffix;
760 spawnable.mSpawnMethod = SpawnMethod::Prefab;
761 prefabs.push_back(spawnable);
762 }
763 }
764}
765
766//static
767void ModuleFactory::GetPresets(std::vector<ModuleFactory::Spawnable>& presets)

Callers

nothing calls this directly

Calls 1

ofToDataPathFunction · 0.85

Tested by

no test coverage detected