| 485 | } |
| 486 | |
| 487 | void 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 | |
| 527 | void DrawLissajous(RollingBuffer* buffer, float x, float y, float w, float h, float r, float g, float b, bool autocorrelationMode /* = true */) |
| 528 | { |
no test coverage detected