[splittiming] Abstraction, prep work.
This commit is contained in:
+18
-13
@@ -173,6 +173,23 @@ void SMLoader::ProcessAttacks( Song &out, MsdFile::value_t sParams )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SMLoader::ProcessInstrumentTracks( Song &out, const RString &sParam )
|
||||||
|
{
|
||||||
|
vector<RString> vs1;
|
||||||
|
split( sParam, ",", vs1 );
|
||||||
|
FOREACH_CONST( RString, vs1, s )
|
||||||
|
{
|
||||||
|
vector<RString> vs2;
|
||||||
|
split( *s, "=", vs2 );
|
||||||
|
if( vs2.size() >= 2 )
|
||||||
|
{
|
||||||
|
InstrumentTrack it = StringToInstrumentTrack( vs2[0] );
|
||||||
|
if( it != InstrumentTrack_Invalid )
|
||||||
|
out.m_sInstrumentTrackFile[it] = vs2[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool SMLoader::ProcessBPMs( TimingData &out, const RString sParam )
|
bool SMLoader::ProcessBPMs( TimingData &out, const RString sParam )
|
||||||
{
|
{
|
||||||
vector<RString> arrayBPMChangeExpressions;
|
vector<RString> arrayBPMChangeExpressions;
|
||||||
@@ -597,19 +614,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out, bool bFromCache
|
|||||||
|
|
||||||
else if( sValueName=="INSTRUMENTTRACK" )
|
else if( sValueName=="INSTRUMENTTRACK" )
|
||||||
{
|
{
|
||||||
vector<RString> vs1;
|
ProcessInstrumentTracks( out, sParams[1] );
|
||||||
split( sParams[1], ",", vs1 );
|
|
||||||
FOREACH_CONST( RString, vs1, s )
|
|
||||||
{
|
|
||||||
vector<RString> vs2;
|
|
||||||
split( *s, "=", vs2 );
|
|
||||||
if( vs2.size() >= 2 )
|
|
||||||
{
|
|
||||||
InstrumentTrack it = StringToInstrumentTrack( vs2[0] );
|
|
||||||
if( it != InstrumentTrack_Invalid )
|
|
||||||
out.m_sInstrumentTrackFile[it] = vs2[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( sValueName=="MUSICLENGTH" )
|
else if( sValueName=="MUSICLENGTH" )
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ namespace SMLoader
|
|||||||
void ProcessBGChanges( Song &out, const RString &sValueName,
|
void ProcessBGChanges( Song &out, const RString &sValueName,
|
||||||
const RString &sPath, const RString &sParam );
|
const RString &sPath, const RString &sParam );
|
||||||
void ProcessAttacks( Song &out, MsdFile::value_t sParams );
|
void ProcessAttacks( Song &out, MsdFile::value_t sParams );
|
||||||
|
void ProcessInstrumentTracks( Song &out, const RString &sParam );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+7
-15
@@ -120,8 +120,12 @@ bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
out.m_SongTiming.m_sFile = sPath;
|
out.m_SongTiming.m_sFile = sPath; // songs still have their fallback timing.
|
||||||
LoadTimingFromSMAFile( msd, out.m_SongTiming );
|
|
||||||
|
int state = SMA_GETTING_SONG_INFO;
|
||||||
|
Steps* pNewNotes = NULL;
|
||||||
|
TimingData stepsTiming;
|
||||||
|
int iRowsPerBeat = -1; // Start with an invalid value: needed for checking.
|
||||||
|
|
||||||
for( unsigned i=0; i<msd.GetNumValues(); i++ )
|
for( unsigned i=0; i<msd.GetNumValues(); i++ )
|
||||||
{
|
{
|
||||||
@@ -175,19 +179,7 @@ bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out )
|
|||||||
|
|
||||||
else if( sValueName=="INSTRUMENTTRACK" )
|
else if( sValueName=="INSTRUMENTTRACK" )
|
||||||
{
|
{
|
||||||
vector<RString> vs1;
|
SMLoader::ProcessInstrumentTracks( out, sParams[1] );
|
||||||
split( sParams[1], ",", vs1 );
|
|
||||||
FOREACH_CONST( RString, vs1, s )
|
|
||||||
{
|
|
||||||
vector<RString> vs2;
|
|
||||||
split( *s, "=", vs2 );
|
|
||||||
if( vs2.size() >= 2 )
|
|
||||||
{
|
|
||||||
InstrumentTrack it = StringToInstrumentTrack( vs2[0] );
|
|
||||||
if( it != InstrumentTrack_Invalid )
|
|
||||||
out.m_sInstrumentTrackFile[it] = vs2[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( sValueName=="MUSICLENGTH" )
|
else if( sValueName=="MUSICLENGTH" )
|
||||||
|
|||||||
+1
-13
@@ -232,19 +232,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
|
|
||||||
else if( sValueName=="INSTRUMENTTRACK" )
|
else if( sValueName=="INSTRUMENTTRACK" )
|
||||||
{
|
{
|
||||||
vector<RString> vs1;
|
SMLoader::ProcessInstrumentTracks( out, sParams[1] );
|
||||||
split( sParams[1], ",", vs1 );
|
|
||||||
FOREACH_CONST( RString, vs1, s )
|
|
||||||
{
|
|
||||||
vector<RString> vs2;
|
|
||||||
split( *s, "=", vs2 );
|
|
||||||
if( vs2.size() >= 2 )
|
|
||||||
{
|
|
||||||
InstrumentTrack it = StringToInstrumentTrack( vs2[0] );
|
|
||||||
if( it != InstrumentTrack_Invalid )
|
|
||||||
out.m_sInstrumentTrackFile[it] = vs2[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( sValueName=="MUSICLENGTH" )
|
else if( sValueName=="MUSICLENGTH" )
|
||||||
|
|||||||
Reference in New Issue
Block a user