Defines the dialog and does data exchange with it.
| 95 | |
| 96 | /// Defines the dialog and does data exchange with it. |
| 97 | void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S) |
| 98 | { |
| 99 | constexpr int Margin = 12; |
| 100 | |
| 101 | static const std::unordered_map<TranslatableString, TranslatableString> extraProviders = { |
| 102 | { XO("Builtin Effects"), XO("Native Audacity") } |
| 103 | }; |
| 104 | |
| 105 | TranslatableStrings pluginProviderNames; |
| 106 | pluginProviderNames.push_back(XO("All")); |
| 107 | mPluginProviderIDs.clear(); |
| 108 | mPluginProviderIDs.push_back({}); |
| 109 | auto& moduleManager = ModuleManager::Get(); |
| 110 | for(auto& [name, provider] : moduleManager.Providers()) |
| 111 | { |
| 112 | //Use same name as in prefs |
| 113 | auto familySymbol = provider->GetOptionalFamilySymbol(); |
| 114 | if(!familySymbol.empty()) |
| 115 | pluginProviderNames.push_back(familySymbol.Msgid()); |
| 116 | else |
| 117 | { |
| 118 | auto it = extraProviders.find(provider->GetSymbol().Msgid()); |
| 119 | if(it != extraProviders.end()) |
| 120 | pluginProviderNames.push_back(it->second); |
| 121 | else |
| 122 | continue; |
| 123 | } |
| 124 | mPluginProviderIDs.push_back(PluginManager::GetID(provider.get())); |
| 125 | } |
| 126 | |
| 127 | S.Prop(1).StartPanel(wxEXPAND); |
| 128 | { |
| 129 | S.StartVerticalLay(true); |
| 130 | { |
| 131 | S.AddSpace(1, Margin); |
| 132 | S.StartHorizontalLay(wxEXPAND, 0); |
| 133 | { |
| 134 | S.AddSpace(Margin, 1); |
| 135 | S.StartHorizontalLay(wxALIGN_LEFT, 0); |
| 136 | { |
| 137 | TranslatableStrings categoryFilterNames; |
| 138 | std::transform( |
| 139 | CategoryFilterValues.begin(), |
| 140 | CategoryFilterValues.end(), |
| 141 | std::back_inserter(categoryFilterNames), |
| 142 | [](const auto& p) { return p.second; }); |
| 143 | const auto selectedCategory = |
| 144 | std::distance( |
| 145 | CategoryFilterValues.begin(), |
| 146 | std::find_if( |
| 147 | CategoryFilterValues.begin(), |
| 148 | CategoryFilterValues.end(), |
| 149 | [category = mPluginsModel->GetFilterCategory()](const auto& p) { |
| 150 | return p.first == category; |
| 151 | } |
| 152 | )); |
| 153 | S |
| 154 | .Id(ID_FilterState) |
nothing calls this directly
no test coverage detected