diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index a9b872794c..0073198195 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -587,6 +587,23 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach { stepsTiming.m_fBeat0OffsetInSeconds = StringToFloat( sParams[1] ); } + + else if( sValueName=="DISPLAYBPM" ) + { + // #DISPLAYBPM:[xxx][xxx:xxx]|[*]; + if( sParams[1] == "*" ) + pNewNotes->SetDisplayBPM(DISPLAY_BPM_RANDOM); + else + { + pNewNotes->SetDisplayBPM(DISPLAY_BPM_SPECIFIED); + float min = StringToFloat(sParams[1]); + pNewNotes->SetMinBPM(min); + if(sParams[2].empty()) + pNewNotes->SetMaxBPM(min); + else + pNewNotes->SetMaxBPM(StringToFloat(sParams[2])); + } + } break; } } diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index db5bc40d50..70578ee0dd 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -335,6 +335,26 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa Trim(attacks, ":"); // just in case something screwy happens. lines.push_back( ssprintf( "#ATTACKS:%s;", attacks.c_str())); + switch( in.GetDisplayBPM() ) + { + case DISPLAY_BPM_ACTUAL: + // write nothing + break; + case DISPLAY_BPM_SPECIFIED: + { + float small = in.GetMinBPM(); + float big = in.GetMaxBPM(); + if (small == big) + lines.push_back( ssprintf( "#DISPLAYBPM:%.6f;", small ) ); + else + lines.push_back( ssprintf( "#DISPLAYBPM:%.6f:%.6f;", small, big ) ); + break; + } + case DISPLAY_BPM_RANDOM: + lines.push_back( ssprintf( "#DISPLAYBPM:*;" ) ); + break; + } + RString sNoteData; in.GetSMNoteData( sNoteData );