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

Function UpdateTarget

Source/SynthGlobals.cpp:487–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485}
486
487void UpdateTarget(IDrawableModule* module)
488{
489 IAudioSource* audioSource = dynamic_cast<IAudioSource*>(module);
490 INoteSource* noteSource = dynamic_cast<INoteSource*>(module);
491 IGridController* grid = dynamic_cast<IGridController*>(module);
492 IPulseSource* pulseSource = dynamic_cast<IPulseSource*>(module);
493 std::string targetName = "";
494 if (audioSource)
495 {
496 for (int i = 0; i < audioSource->GetNumTargets(); ++i)
497 {
498 IDrawableModule* target = dynamic_cast<IDrawableModule*>(audioSource->GetTarget(i));
499 if (target)
500 targetName = target->Path();
501 else
502 targetName = "";
503 module->GetSaveData().SetString("target" + (i == 0 ? "" : ofToString(i + 1)), targetName);
504 }
505 }
506 if (noteSource || grid || pulseSource)
507 {
508 if (module->GetPatchCableSource())
509 {
510 const std::vector<PatchCable*>& cables = module->GetPatchCableSource()->GetPatchCables();
511 for (int i = 0; i < cables.size(); ++i)
512 {
513 PatchCable* cable = cables[i];
514 IClickable* target = cable->GetTarget();
515 if (target)
516 {
517 targetName += target->Path();
518 if (i < cables.size() - 1)
519 targetName += ",";
520 }
521 }
522 }
523 module->GetSaveData().SetString("target", targetName);
524 }
525}
526
527void DrawLissajous(RollingBuffer* buffer, float x, float y, float w, float h, float r, float g, float b, bool autocorrelationMode /* = true */)
528{

Callers 2

WriteModulesMethod · 0.85
ReloadSaveDataMethod · 0.85

Calls 8

ofToStringFunction · 0.85
PathMethod · 0.80
SetStringMethod · 0.80
GetSaveDataMethod · 0.80
sizeMethod · 0.80
GetNumTargetsMethod · 0.45
GetTargetMethod · 0.45
GetPatchCableSourceMethod · 0.45

Tested by

no test coverage detected