Skip to content

Commit

Permalink
[#59] TrackEditor (95.5: Reversing also meta-data when reversing the …
Browse files Browse the repository at this point in the history
…track)
  • Loading branch information
tomas-nestorovic committed Dec 28, 2024
1 parent 2bb94a8 commit 2374669
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Main/src/Image_TrackRW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,6 @@

CImage::CTrackReaderWriter &CImage::CTrackReaderWriter::Reverse(){
// reverses timing of this Track
//TODO: metadata reversal
// - reversing Indices
const auto tTotal=GetTotalTime();
for( BYTE i=0; i<GetIndexCount()/2; i++ )
Expand All @@ -1841,5 +1840,14 @@
std::swap( logTimes[i], logTimes[nLogTimes-1-i] );
for( DWORD i=0; i<nLogTimes; i++ )
logTimes[i]=tTotal-logTimes[i];
// - reversing MetaData
CMetaData metaData;
for each( auto mdi in GetMetaData() ){
std::swap( mdi.tStart, mdi.tEnd );
mdi.tStart=tTotal-mdi.tStart;
mdi.tEnd=tTotal-mdi.tEnd;
metaData.insert(mdi);
}
pLogTimesInfo->metaData=metaData;
return *this;
}

0 comments on commit 2374669

Please sign in to comment.