mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 08:29:27 +02:00
Bug 2584 - "GetInfo: Envelopes" returns incorrect track numbers
Also clip count resets to zero on each new track. Also fixed GetInfo: Clips to count all tracks, not just wave tracks.
This commit is contained in:
parent
69e0d7d114
commit
d6a6b256fe
@ -510,7 +510,8 @@ bool GetInfoCommand::SendClips(const CommandContext &context)
|
||||
auto &tracks = TrackList::Get( context.project );
|
||||
int i=0;
|
||||
context.StartArray();
|
||||
for (auto waveTrack : tracks.Leaders<WaveTrack>()) {
|
||||
for (auto t : tracks.Leaders()) {
|
||||
t->TypeSwitch([&](WaveTrack *waveTrack) {
|
||||
WaveClipPointers ptrs(waveTrack->SortedClipArray());
|
||||
for (WaveClip * pClip : ptrs) {
|
||||
context.StartStruct();
|
||||
@ -520,6 +521,8 @@ bool GetInfoCommand::SendClips(const CommandContext &context)
|
||||
context.AddItem(pClip->GetColourIndex(), "color");
|
||||
context.EndStruct();
|
||||
}
|
||||
});
|
||||
// Per track numbering counts all tracks
|
||||
i++;
|
||||
}
|
||||
context.EndArray();
|
||||
@ -533,8 +536,10 @@ bool GetInfoCommand::SendEnvelopes(const CommandContext &context)
|
||||
int i=0;
|
||||
int j=0;
|
||||
context.StartArray();
|
||||
for (auto waveTrack : tracks.Leaders<WaveTrack>()) {
|
||||
for (auto t : tracks.Leaders()) {
|
||||
t->TypeSwitch([&](WaveTrack *waveTrack) {
|
||||
WaveClipPointers ptrs(waveTrack->SortedClipArray());
|
||||
j = 0;
|
||||
for (WaveClip * pClip : ptrs) {
|
||||
context.StartStruct();
|
||||
context.AddItem((double)i, "track");
|
||||
@ -557,6 +562,9 @@ bool GetInfoCommand::SendEnvelopes(const CommandContext &context)
|
||||
context.EndStruct();
|
||||
j++;
|
||||
}
|
||||
});
|
||||
// Per track numbering counts all tracks
|
||||
i++;
|
||||
}
|
||||
context.EndArray();
|
||||
|
||||
@ -601,8 +609,6 @@ bool GetInfoCommand::SendLabels(const CommandContext &context)
|
||||
}
|
||||
context.EndArray();
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user