This commit is contained in:
Jason Felds
2011-08-15 18:12:12 -04:00
parent 8eb1a2c17a
commit e26973d71d
+32 -2
View File
@@ -892,6 +892,7 @@ enum
FOUND_BPM_CHANGE, FOUND_BPM_CHANGE,
FOUND_STOP, FOUND_STOP,
FOUND_DELAY, FOUND_DELAY,
FOUND_STOP_DELAY, // we have these two on the same row.
FOUND_MARKER, FOUND_MARKER,
NOT_FOUND NOT_FOUND
}; };
@@ -940,8 +941,9 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset( float fElapsedTime, float
if (itSS != segs[SEGMENT_STOP].end() && if (itSS != segs[SEGMENT_STOP].end() &&
(*itSS)->GetRow() < iEventRow ) // && iEventType != FOUND_DELAY ) (*itSS)->GetRow() < iEventRow ) // && iEventType != FOUND_DELAY )
{ {
int tmpRow = iEventRow;
iEventRow = (*itSS)->GetRow(); iEventRow = (*itSS)->GetRow();
iEventType = FOUND_STOP; iEventType = (tmpRow == iEventRow) ? FOUND_STOP_DELAY : FOUND_STOP;
} }
if (itWS != segs[SEGMENT_WARP].end() && if (itWS != segs[SEGMENT_WARP].end() &&
(*itWS)->GetRow() < iEventRow ) (*itWS)->GetRow() < iEventRow )
@@ -1001,8 +1003,36 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset( float fElapsedTime, float
} }
fLastTime = fNextEventTime; fLastTime = fNextEventTime;
itSS ++; itSS ++;
break;
}
case FOUND_STOP_DELAY:
{
const DelaySegment *ds = static_cast<DelaySegment *>(*itDS);
const StopSegment *ss = static_cast<StopSegment *>(*itSS);
fNextEventTime = fLastTime + ds->GetPause();
if ( fElapsedTime < fNextEventTime )
{
bFreezeOut = false;
bDelayOut = true;
fBeatOut = ds->GetBeat();
fBPSOut = fBPS;
return;
}
itDS++;
fNextEventTime += ss->GetPause();
if ( fElapsedTime < fNextEventTime )
{
bFreezeOut = true;
bDelayOut = false;
fBeatOut = ss->GetBeat();
fBPSOut = fBPS;
return;
}
fLastTime = fNextEventTime;
itSS++;
break;
} }
break;
case FOUND_WARP: case FOUND_WARP:
{ {
bIsWarping = true; bIsWarping = true;