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

Method SetUpPluginsDropdown

Source/TitleBar.cpp:242–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242void SpawnListManager::SetUpPluginsDropdown()
243{
244 std::vector<ModuleFactory::Spawnable> list;
245
246 ModuleFactory::Spawnable scanDummy;
247 scanDummy.mLabel = kManagePluginsLabel;
248 list.push_back(scanDummy);
249
250 std::vector<juce::PluginDescription> recentPlugins;
251 VSTLookup::GetRecentPlugins(recentPlugins, 8);
252 for (auto& pluginDesc : recentPlugins)
253 {
254 ModuleFactory::Spawnable spawnable{};
255 spawnable.mLabel = pluginDesc.name.toStdString();
256 spawnable.mDecorator = "[" + ModuleFactory::Spawnable::GetPluginLabel(pluginDesc) + "]";
257 spawnable.mPluginDesc = pluginDesc;
258 spawnable.mSpawnMethod = ModuleFactory::SpawnMethod::Plugin;
259 list.push_back(spawnable);
260 }
261
262 std::vector<juce::PluginDescription> vsts;
263 VSTLookup::GetAvailableVSTs(vsts);
264 for (auto& pluginDesc : vsts)
265 {
266 ModuleFactory::Spawnable spawnable{};
267 spawnable.mLabel = pluginDesc.name.toStdString();
268 spawnable.mDecorator = "[" + ModuleFactory::Spawnable::GetPluginLabel(pluginDesc) + "]";
269 spawnable.mPluginDesc = pluginDesc;
270 spawnable.mSpawnMethod = ModuleFactory::SpawnMethod::Plugin;
271 list.push_back(spawnable);
272 }
273
274 mPlugins.SetList(list);
275 mPlugins.GetList()->ClearSeparators();
276 mPlugins.GetList()->AddSeparator(1);
277 if (!recentPlugins.empty())
278 mPlugins.GetList()->AddSeparator((int)recentPlugins.size() + 1);
279}
280
281void TitleBar::ListLayouts()
282{

Callers 1

DropdownClickedMethod · 0.80

Calls 8

GetRecentPluginsFunction · 0.85
GetAvailableVSTsFunction · 0.85
SetListMethod · 0.80
ClearSeparatorsMethod · 0.80
GetListMethod · 0.80
AddSeparatorMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected