| 363 | } |
| 364 | |
| 365 | TreeViewItem* 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 | |
| 393 | const String& PluginSearchWindow::normalizeCategory(const String& category) { |
| 394 | static std::unordered_map<String, String> map = {{"Fx", "Effect"}, {"Synth", "Instrument"}, {"Waves", ""}}; |
nothing calls this directly
no outgoing calls
no test coverage detected