Added preview tag to NotesLoaderBMS. Changed Song to check the preview file for sample length instead of the simfile if the preview file is set.

This commit is contained in:
Kyzentun
2015-03-04 13:10:51 -07:00
parent 0318f07d2d
commit 46d215aed3
3 changed files with 23 additions and 1 deletions
+16
View File
@@ -575,6 +575,22 @@ void Song::TidyUpData( bool fromCache, bool /* duringCache */ )
m_fMusicLengthSeconds);
}
if(!m_PreviewFile.empty())
{
RString error;
RageSoundReader* sample= RageSoundReader_FileReader::OpenFile(GetPreviewMusicPath(), error);
if(sample == NULL)
{
LOG->UserLog( "Preview file", GetPreviewMusicPath(), "couldn't be opened: %s", error.c_str() );
m_PreviewFile= "";
}
else
{
m_fMusicSampleLengthSeconds= sample->GetLength() / 1000.0f;
delete sample;
}
}
if( m_fMusicLengthSeconds < 0 )
{
LOG->UserLog("Sound file",