From 6d2f449bcf2ec72323e1e2acdd421cdbc6382ed2 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 4 Apr 2005 01:54:55 +0000 Subject: [PATCH] play sounds from Xml transitions --- stepmania/src/Transition.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/stepmania/src/Transition.cpp b/stepmania/src/Transition.cpp index 88418f39e4..0da3539347 100644 --- a/stepmania/src/Transition.cpp +++ b/stepmania/src/Transition.cpp @@ -26,13 +26,14 @@ void Transition::Load( CString sBGAniDir ) m_State = waiting; // load sound from file specified by ini, or use the first sound in the directory + if( IsADirectory(sBGAniDir) ) { IniFile ini; ini.ReadFile( sBGAniDir+"/BGAnimation.ini" ); CString sSoundFileName; - if( ini.GetValue("BGAnimation","Sound",sSoundFileName) ) + if( ini.GetValue("BGAnimation","Sound", sSoundFileName) ) { FixSlashesInPlace( sSoundFileName ); CString sPath = sBGAniDir+sSoundFileName; @@ -44,6 +45,17 @@ void Transition::Load( CString sBGAniDir ) m_sound.Load( sBGAniDir ); } } + else if( GetExtension(sBGAniDir).CompareNoCase("xml") == 0 ) + { + CString sSoundFile; + XNode xml; + PARSEINFO pi; + xml.LoadFromFile( sBGAniDir, &pi ); + if( xml.GetAttrValue( "Sound", sSoundFile ) ) + { + m_sound.Load( Dirname(sBGAniDir) + sSoundFile ); + } + } }