DivSongTimestamps, part 3

This commit is contained in:
tildearrow 2025-10-29 02:39:52 -05:00
parent 2f11128c8d
commit ecfea6033a
6 changed files with 48 additions and 10 deletions

View file

@ -621,6 +621,15 @@ void DivSubSong::calcTimestamps(int chans, std::vector<DivGroovePattern>& groove
break;
}
// log row time here
if (!endOfSong) {
if (rowChanged) {
if (ts.orders[prevOrder]==NULL) ts.orders[prevOrder]=new DivSongTimestamps::Timestamp[DIV_MAX_ROWS];
ts.orders[prevOrder][prevRow]=DivSongTimestamps::Timestamp(ts.totalSeconds,ts.totalMicros);
rowChanged=false;
}
}
// update playback time
double dt=divider*((double)virtualTempoN/(double)MAX(1,virtualTempoD));
ts.totalTicks++;
@ -636,15 +645,6 @@ void DivSubSong::calcTimestamps(int chans, std::vector<DivGroovePattern>& groove
// who's gonna play a song for 68 years?
if (ts.totalSeconds<0x7fffffff) ts.totalSeconds++;
}
// log row time here
if (!endOfSong) {
if (rowChanged) {
if (ts.orders[curOrder]==NULL) ts.orders[curOrder]=new DivSongTimestamps::Timestamp[DIV_MAX_ROWS];
ts.orders[curOrder][curRow]=DivSongTimestamps::Timestamp(ts.totalSeconds,ts.totalMicros);
rowChanged=false;
}
}
if (ts.maxRow[curOrder]<curRow) ts.maxRow[curOrder]=curRow;
}