MCPcopy Create free account
hub / github.com/christophhart/HISE / getOptionsFor

Method getOptionsFor

hi_scripting/scripting/api/ScriptingApiContent.cpp:447–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447StringArray ScriptingApi::Content::ScriptComponent::getOptionsFor(const Identifier &id)
448{
449 if (id == getIdFor(macroControl))
450 {
451 StringArray sa;
452
453 sa.add("No MacroControl");
454 for (int i = 0; i < 8; i++)
455 {
456 sa.add("Macro " + String(i + 1));
457 }
458
459 return sa;
460 }
461 else if (id == getIdFor(parentComponent))
462 {
463 auto c = parent;
464
465 StringArray sa;
466
467 sa.add("");
468
469 for (int i = 0; i < c->getNumComponents(); i++)
470 {
471 if (c->getComponent(i) == this) break;
472 sa.add(c->getComponent(i)->getName().toString());
473 }
474
475 return sa;
476 }
477 else if (id == getIdFor(automationId))
478 {
479 StringArray sa;
480 sa.add("");
481 sa.addArray(getScriptProcessor()->getMainController_()->getUserPresetHandler().getCustomAutomationIds());
482 return sa;
483 }
484 else if (id == getIdFor(processorId))
485 {
486 auto sa = ProcessorHelpers::getListOfAllConnectableProcessors(dynamic_cast<Processor*>(getScriptProcessor()));
487 sa.add("GlobalCable");
488 return sa;
489 }
490 else if (id == getIdFor(parameterId))
491 {
492 if (connectedProcessor.get() != nullptr)
493 {
494 return ProcessorHelpers::getListOfAllParametersForProcessor(connectedProcessor.get());
495 }
496 else if (globalConnection != nullptr)
497 {
498 auto m = scriptnode::routing::GlobalRoutingManager::Helpers::getOrCreate(getScriptProcessor()->getMainController_());
499
500 return m->getIdList(scriptnode::routing::GlobalRoutingManager::SlotBase::SlotType::Cable);
501 }
502 }
503 else if (id == getIdFor(linkedTo))
504 {

Callers 1

getMacroNamesMethod · 0.45

Calls 15

getObjectNameFunction · 0.85
StringArrayFunction · 0.85
getProcessorFunction · 0.85
getMainController_Method · 0.80
getCurrentImagePoolMethod · 0.80
getAvailableStylesMethod · 0.80
fillWithCustomFontsMethod · 0.80
getNameMethod · 0.65
StringClass · 0.50
addMethod · 0.45

Tested by

no test coverage detected