| 445 | } |
| 446 | |
| 447 | StringArray 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 | { |
no test coverage detected