MCPcopy Create free account
hub / github.com/apohl79/audiogridder / createPluginMenu

Method createPluginMenu

Plugin/Source/PluginSearchWindow.cpp:365–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365TreeViewItem* PluginSearchWindow::createPluginMenu(const String& name, MenuLevel& level,
366 PluginSearchWindow::ClickFunction addFn) {
367 traceScope();
368 auto onOpenClose = [this] { updateHeight(); };
369 auto* m = new TreeFolder(name, onOpenClose);
370 if (nullptr != level.entryMap) {
371 for (auto& pair : *level.entryMap) {
372 auto& plug = pair.second;
373 auto* plugEntry = new TreePlugin(plug, onOpenClose, /*m_showType*/ false, true);
374 m->addSubItem(plugEntry);
375 if (plug.getLayouts().isEmpty()) {
376 plugEntry->addSubItem(new TreeLayout(plug, "Default", addFn));
377 } else {
378 for (auto& l : plug.getLayouts()) {
379 plugEntry->addSubItem(new TreeLayout(plug, l, addFn));
380 }
381 }
382 plugEntry->setOpenness(TreeViewItem::Openness::opennessClosed);
383 }
384 }
385 if (nullptr != level.subMap) {
386 for (auto& pair : *level.subMap) {
387 m->addSubItem(createPluginMenu(pair.first, pair.second, addFn));
388 }
389 }
390 return m;
391}
392
393const String& PluginSearchWindow::normalizeCategory(const String& category) {
394 static std::unordered_map<String, String> map = {{"Fx", "Effect"}, {"Synth", "Instrument"}, {"Waves", ""}};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected