MCPcopy Create free account
hub / github.com/VCVRack/Befaco / setAlgorithm

Method setAlgorithm

src/NoisePlethora.cpp:529–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527 }
528
529 void setAlgorithm(int section, std::string_view algorithmName) {
530
531 if (section > 1) {
532 return;
533 }
534
535 for (int bank = 0; bank < numBanks; ++bank) {
536 for (int program = 0; program < getBankForIndex(bank).getSize(); ++program) {
537 if (getBankForIndex(bank).getProgramName(program) == algorithmName) {
538 programSelector.setMode(section);
539 programSelector.getCurrent().setBank(bank);
540 programSelector.getCurrent().setProgram(program);
541
542 return;
543 }
544 }
545 }
546
547 DEBUG("WARNING: Didn't find %s in programSelector", algorithmName.data());
548 }
549
550 void dataFromJson(json_t* rootJ) override {
551 json_t* bankAJ = json_object_get(rootJ, "algorithmA");

Callers 1

appendContextMenuMethod · 0.80

Calls 5

getProgramNameMethod · 0.80
setModeMethod · 0.80
setBankMethod · 0.80
setProgramMethod · 0.80
getSizeMethod · 0.45

Tested by

no test coverage detected