From 50fcf591d9f006c758c9a59159cbc01c4643d710 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 14 Jul 2003 23:54:54 +0000 Subject: [PATCH] Add RageSoundManager::GetMusicPath. RageSoundManager::PlayMusic: unload sounds when we stop playing. --- stepmania/src/RageSoundManager.cpp | 8 ++++++++ stepmania/src/RageSoundManager.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/stepmania/src/RageSoundManager.cpp b/stepmania/src/RageSoundManager.cpp index f3eb66854d..19fe30284b 100644 --- a/stepmania/src/RageSoundManager.cpp +++ b/stepmania/src/RageSoundManager.cpp @@ -256,6 +256,11 @@ void RageSoundManager::MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, floa } } +CString RageSoundManager::GetMusicPath() const +{ + return music->GetLoadedFilePath(); +} + void RageSoundManager::PlayMusic(CString file, bool force_loop, float start_sec, float length_sec, float fade_len) { // LOG->Trace("play '%s' (current '%s')", file.c_str(), music->GetLoadedFilePath().c_str()); @@ -269,7 +274,10 @@ void RageSoundManager::PlayMusic(CString file, bool force_loop, float start_sec, /* If file is blank, just stop. */ if(file.empty()) + { + music->Unload(); return; + } music->Load( file, false ); if( force_loop ) diff --git a/stepmania/src/RageSoundManager.h b/stepmania/src/RageSoundManager.h index 02b752a83e..d564161f1e 100644 --- a/stepmania/src/RageSoundManager.h +++ b/stepmania/src/RageSoundManager.h @@ -62,6 +62,8 @@ public: void PlayMusic(CString file, bool force_loop = false, float start_sec = -1, float length_sec = -1, float fade_len = 0); void StopMusic() { PlayMusic(""); } + CString GetMusicPath() const; + static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume); };