MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / DeleteCablesForControl

Method DeleteCablesForControl

Source/ModuleContainer.cpp:381–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381void ModuleContainer::DeleteCablesForControl(const IUIControl* control)
382{
383 // Remove all cables that targetted control on this module
384 std::vector<IDrawableModule*> modules;
385 TheSynth->GetAllModules(modules);
386 std::vector<PatchCable*> cablesToDestroy;
387 for (const auto module_iter : modules)
388 {
389 for (const auto source : module_iter->GetPatchCableSources())
390 {
391 for (const auto cable : source->GetPatchCables())
392 {
393 if (cable->GetTarget() == control)
394 {
395 cablesToDestroy.push_back(cable);
396 break;
397 }
398 }
399 }
400 }
401 for (const auto cable : cablesToDestroy)
402 cable->Destroy(false);
403}
404
405IDrawableModule* ModuleContainer::FindModule(std::string name, bool fail)
406{

Callers 1

~MappingMethod · 0.80

Calls 4

GetPatchCableSourcesMethod · 0.80
DestroyMethod · 0.80
GetAllModulesMethod · 0.45
GetTargetMethod · 0.45

Tested by

no test coverage detected