From 53e264c10d034fef463cca25f8fd699c18c0a502 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 20 Feb 2004 05:35:05 +0000 Subject: [PATCH] make Song not depend on SOUNDMAN --- stepmania/src/Song.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 494c80a9cd..d471c396bb 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -17,7 +17,7 @@ #include "RageLog.h" #include "IniFile.h" #include "NoteData.h" -#include "RageSound.h" +#include "RageSoundReader_FileReader.h" #include "RageException.h" #include "SongManager.h" #include "SongCacheIndex.h" @@ -491,10 +491,14 @@ void Song::TidyUpData() /* This must be done before radar calculation. */ if( HasMusic() ) { - RageSound sound; - sound.Load( GetMusicPath(), false ); /* don't pre-cache */ + CString error; + SoundReader *Sample = SoundReader_FileReader::OpenFile( GetMusicPath(), error ); + if( Sample == NULL ) + RageException::Throw( "Error opening sound '%s': '%s'", + GetMusicPath().c_str(), error.c_str()); - m_fMusicLengthSeconds = sound.GetLengthSeconds(); + m_fMusicLengthSeconds = Sample->GetLength() / 1000.0f; + delete Sample; if(m_fMusicLengthSeconds == -1) {