Stops (and Delays) now templated.

This is all of them at this present time.

At some point in the future, we should make
DelaySegments separate from StopSegments.
This commit is contained in:
Jason Felds
2011-06-01 09:50:34 -04:00
parent 50e93045cc
commit df6a00b53e
16 changed files with 197 additions and 194 deletions
+11 -17
View File
@@ -116,10 +116,7 @@ static void WriteGlobalTags( RageFile &f, Song &out )
int iRow = out.m_SongTiming.m_WarpSegments[i].GetRow();
float fBPS = 60 / out.m_SongTiming.GetBPMAtRow(iRow);
float fSkip = fBPS * out.m_SongTiming.m_WarpSegments[i].GetLength();
StopSegment ss;
ss.m_iStartRow = iRow;
ss.m_fStopSeconds = -fSkip;
ss.m_bDelay = false; // Best to be sure.
StopSegment ss(iRow, -fSkip, false);
out.m_SongTiming.AddStopSegment( ss );
}
}
@@ -128,21 +125,18 @@ static void WriteGlobalTags( RageFile &f, Song &out )
for( unsigned i=0; i<out.m_SongTiming.m_StopSegments.size(); i++ )
{
const StopSegment &fs = out.m_SongTiming.m_StopSegments[i];
int iRow = fs.m_iStartRow;
float fBeat = NoteRowToBeat(!fs.m_bDelay ? iRow : iRow - 1);
float fBeat = fs.GetBeat();
if (fs.GetDelay()) fBeat--;
if(!fs.m_bDelay)
f.PutLine( ssprintf( "%.3f=%.3f", fBeat, fs.GetPause() ) );
if( i != out.m_SongTiming.m_StopSegments.size()-1 )
f.Write( "," );
if( fs.GetPause() < 0 )
{
f.PutLine( ssprintf( "%.3f=%.3f", fBeat, fs.m_fStopSeconds ) );
if( i != out.m_SongTiming.m_StopSegments.size()-1 )
f.Write( "," );
if( fs.m_fStopSeconds < 0 )
{
out.m_SongTiming.m_StopSegments.erase(
out.m_SongTiming.m_StopSegments.begin()+i,
out.m_SongTiming.m_StopSegments.begin()+i+1 );
i--;
}
out.m_SongTiming.m_StopSegments.erase(
out.m_SongTiming.m_StopSegments.begin()+i,
out.m_SongTiming.m_StopSegments.begin()+i+1 );
i--;
}
}
f.PutLine( ";" );