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

Method addPluginItems

Server/Source/PluginListComponent.cpp:262–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262void PluginListComponent::addPluginItems(const std::vector<int> indexes) {
263 auto types = m_list.getTypes();
264 int numTypes = types.size();
265 int numBlacklistedFiles = m_list.getBlacklistedFiles().size();
266 std::vector<String> names;
267
268 for (int index : indexes) {
269 if (index >= (numTypes + numBlacklistedFiles)) {
270 index -= numTypes;
271 index -= numBlacklistedFiles;
272 auto it = m_excludeList.begin();
273 while (index-- > 0 && it != m_excludeList.end()) it++;
274 if (it != m_excludeList.end()) {
275 auto name = *it;
276 names.push_back(name);
277 }
278 }
279 }
280
281 for (auto& name : names) {
282 m_excludeList.erase(name);
283 }
284
285 if (auto srv = getApp()->getServer()) {
286 srv->saveConfig();
287 srv->addPlugins(names, [this, names](bool success, const String& name) {
288 if (!success) {
289 m_excludeList.insert(name);
290 }
291 });
292 }
293}
294
295void PluginListComponent::rescanPluginItems(const std::vector<int> indexes) {
296 auto types = m_list.getTypes();

Callers

nothing calls this directly

Calls 8

push_backMethod · 0.80
eraseMethod · 0.80
addPluginsMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getServerMethod · 0.45
saveConfigMethod · 0.45

Tested by

no test coverage detected