[splittiming] #OFFSET done. Now for the rest.

This commit is contained in:
Jason Felds
2011-05-14 18:22:36 -04:00
parent efb37b47d7
commit 2652a7c10b
+17 -8
View File
@@ -262,6 +262,11 @@ bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out )
//else if( sValueName=="SAMPLEPATH" ) //else if( sValueName=="SAMPLEPATH" )
//out.m_sMusicSamplePath = sParams[1]; //out.m_sMusicSamplePath = sParams[1];
else if( sValueName=="LISTSORT" )
{
;
}
else if( sValueName=="DISPLAYBPM" ) else if( sValueName=="DISPLAYBPM" )
{ {
// #DISPLAYBPM:[xxx][xxx:xxx]|[*]; // #DISPLAYBPM:[xxx][xxx:xxx]|[*];
@@ -302,7 +307,7 @@ bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out )
else else
{ {
state = SMA_GETTING_STEP_INFO; state = SMA_GETTING_STEP_INFO;
// start again. pNewNotes = out.CreateSteps();
} }
} }
@@ -352,6 +357,15 @@ bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out )
} }
} }
else if( sValueName=="OFFSET" )
{
TimingData &timing = (state == SMA_GETTING_STEP_INFO
? pNewNotes->m_Timing : out.m_SongTiming);
timing.m_fBeat0OffsetInSeconds = StringToFloat( sParams[1] );
}
else if( sValueName=="KEYSOUNDS" ) else if( sValueName=="KEYSOUNDS" )
{ {
split( sParams[1], ",", out.m_vsKeysoundFile ); split( sParams[1], ",", out.m_vsKeysoundFile );
@@ -371,7 +385,6 @@ bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out )
continue; continue;
} }
Steps* pNewNotes = out.CreateSteps();
LoadFromSMATokens( LoadFromSMATokens(
sParams[1], sParams[1],
sParams[2], sParams[2],
@@ -387,7 +400,7 @@ bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out )
* We used to check for timing data in this section. That has * We used to check for timing data in this section. That has
* since been moved to a dedicated function. * since been moved to a dedicated function.
*/ */
else if( sValueName=="OFFSET" || sValueName=="BPMS" || sValueName=="STOPS" || sValueName=="FREEZES" || sValueName=="DELAYS" || sValueName=="TIMESIGNATURES" || sValueName=="LEADTRACK" || sValueName=="TICKCOUNTS" ) else if( sValueName=="BPMS" || sValueName=="STOPS" || sValueName=="FREEZES" || sValueName=="DELAYS" || sValueName=="TIMESIGNATURES" || sValueName=="LEADTRACK" || sValueName=="TICKCOUNTS" )
; ;
else else
LOG->UserLog( "Song file", sPath, "has an unexpected value named \"%s\".", sValueName.c_str() ); LOG->UserLog( "Song file", sPath, "has an unexpected value named \"%s\".", sValueName.c_str() );
@@ -420,11 +433,7 @@ void SMALoader::LoadTimingFromSMAFile( const MsdFile &msd, TimingData &out )
RString sValueName = sParams[0]; RString sValueName = sParams[0];
sValueName.MakeUpper(); sValueName.MakeUpper();
if( sValueName=="OFFSET" ) if( sValueName=="STOPS" )
{
out.m_fBeat0OffsetInSeconds = StringToFloat( sParams[1] );
}
else if( sValueName=="STOPS" )
{ {
vector<RString> arrayFreezeExpressions; vector<RString> arrayFreezeExpressions;
split( sParams[1], ",", arrayFreezeExpressions ); split( sParams[1], ",", arrayFreezeExpressions );