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,16 +510,19 @@ bool GetInfoCommand::SendClips(const CommandContext &context)
|
|||||||
auto &tracks = TrackList::Get( context.project );
|
auto &tracks = TrackList::Get( context.project );
|
||||||
int i=0;
|
int i=0;
|
||||||
context.StartArray();
|
context.StartArray();
|
||||||
for (auto waveTrack : tracks.Leaders<WaveTrack>()) {
|
for (auto t : tracks.Leaders()) {
|
||||||
WaveClipPointers ptrs( waveTrack->SortedClipArray());
|
t->TypeSwitch([&](WaveTrack *waveTrack) {
|
||||||
for(WaveClip * pClip : ptrs ) {
|
WaveClipPointers ptrs(waveTrack->SortedClipArray());
|
||||||
context.StartStruct();
|
for (WaveClip * pClip : ptrs) {
|
||||||
context.AddItem( (double)i, "track" );
|
context.StartStruct();
|
||||||
context.AddItem( pClip->GetStartTime(), "start" );
|
context.AddItem((double)i, "track");
|
||||||
context.AddItem( pClip->GetEndTime(), "end" );
|
context.AddItem(pClip->GetStartTime(), "start");
|
||||||
context.AddItem( pClip->GetColourIndex(), "color" );
|
context.AddItem(pClip->GetEndTime(), "end");
|
||||||
context.EndStruct();
|
context.AddItem(pClip->GetColourIndex(), "color");
|
||||||
}
|
context.EndStruct();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Per track numbering counts all tracks
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
context.EndArray();
|
context.EndArray();
|
||||||
@ -533,30 +536,35 @@ bool GetInfoCommand::SendEnvelopes(const CommandContext &context)
|
|||||||
int i=0;
|
int i=0;
|
||||||
int j=0;
|
int j=0;
|
||||||
context.StartArray();
|
context.StartArray();
|
||||||
for (auto waveTrack : tracks.Leaders<WaveTrack>()) {
|
for (auto t : tracks.Leaders()) {
|
||||||
WaveClipPointers ptrs( waveTrack->SortedClipArray());
|
t->TypeSwitch([&](WaveTrack *waveTrack) {
|
||||||
for(WaveClip * pClip : ptrs ) {
|
WaveClipPointers ptrs(waveTrack->SortedClipArray());
|
||||||
context.StartStruct();
|
j = 0;
|
||||||
context.AddItem( (double)i, "track" );
|
for (WaveClip * pClip : ptrs) {
|
||||||
context.AddItem( (double)j, "clip" );
|
context.StartStruct();
|
||||||
context.AddItem( pClip->GetStartTime(), "start" );
|
context.AddItem((double)i, "track");
|
||||||
Envelope * pEnv = pClip->GetEnvelope();
|
context.AddItem((double)j, "clip");
|
||||||
context.StartField( "points" );
|
context.AddItem(pClip->GetStartTime(), "start");
|
||||||
context.StartArray();
|
Envelope * pEnv = pClip->GetEnvelope();
|
||||||
double offset = pEnv->GetOffset();
|
context.StartField("points");
|
||||||
for( size_t k = 0; k < pEnv->GetNumberOfPoints(); k++)
|
context.StartArray();
|
||||||
{
|
double offset = pEnv->GetOffset();
|
||||||
context.StartStruct( );
|
for (size_t k = 0; k < pEnv->GetNumberOfPoints(); k++)
|
||||||
context.AddItem( (*pEnv)[k].GetT()+offset, "t" );
|
{
|
||||||
context.AddItem( (*pEnv)[k].GetVal(), "y" );
|
context.StartStruct();
|
||||||
|
context.AddItem((*pEnv)[k].GetT() + offset, "t");
|
||||||
|
context.AddItem((*pEnv)[k].GetVal(), "y");
|
||||||
|
context.EndStruct();
|
||||||
|
}
|
||||||
|
context.EndArray();
|
||||||
|
context.EndField();
|
||||||
|
context.AddItem(pClip->GetEndTime(), "end");
|
||||||
context.EndStruct();
|
context.EndStruct();
|
||||||
|
j++;
|
||||||
}
|
}
|
||||||
context.EndArray();
|
});
|
||||||
context.EndField();
|
// Per track numbering counts all tracks
|
||||||
context.AddItem( pClip->GetEndTime(), "end" );
|
i++;
|
||||||
context.EndStruct();
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
context.EndArray();
|
context.EndArray();
|
||||||
|
|
||||||
@ -601,8 +609,6 @@ bool GetInfoCommand::SendLabels(const CommandContext &context)
|
|||||||
}
|
}
|
||||||
context.EndArray();
|
context.EndArray();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user