| 551 | } |
| 552 | |
| 553 | bool GetInfoCommand::SendEnvelopes(const CommandContext &context) |
| 554 | { |
| 555 | auto &tracks = TrackList::Get( context.project ); |
| 556 | int i=0; |
| 557 | int j=0; |
| 558 | context.StartArray(); |
| 559 | for (auto t : tracks) { |
| 560 | t->TypeSwitch([&](WaveTrack &waveTrack) { |
| 561 | auto ptrs = waveTrack.SortedIntervalArray(); |
| 562 | j = 0; |
| 563 | for (auto &pClip : ptrs) { |
| 564 | context.StartStruct(); |
| 565 | context.AddItem((double)i, "track"); |
| 566 | context.AddItem((double)j, "clip"); |
| 567 | context.AddItem(pClip->GetPlayStartTime(), "start"); |
| 568 | const auto pEnv = &pClip->GetEnvelope(); |
| 569 | context.StartField("points"); |
| 570 | context.StartArray(); |
| 571 | double offset = pEnv->GetOffset(); |
| 572 | for (size_t k = 0; k < pEnv->GetNumberOfPoints(); k++) |
| 573 | { |
| 574 | context.StartStruct(); |
| 575 | context.AddItem((*pEnv)[k].GetT() + offset, "t"); |
| 576 | context.AddItem((*pEnv)[k].GetVal(), "y"); |
| 577 | context.EndStruct(); |
| 578 | } |
| 579 | context.EndArray(); |
| 580 | context.EndField(); |
| 581 | context.AddItem(pClip->GetPlayEndTime(), "end"); |
| 582 | context.EndStruct(); |
| 583 | j++; |
| 584 | } |
| 585 | }); |
| 586 | // Per track numbering counts all tracks |
| 587 | i++; |
| 588 | } |
| 589 | context.EndArray(); |
| 590 | |
| 591 | return true; |
| 592 | } |
| 593 | |
| 594 | |
| 595 | bool GetInfoCommand::SendLabels(const CommandContext &context) |
nothing calls this directly
no test coverage detected