Add RageSoundManager::GetMusicPath.

RageSoundManager::PlayMusic: unload sounds when we stop playing.
This commit is contained in:
Glenn Maynard
2003-07-14 23:54:54 +00:00
parent 7b9f4830b4
commit 50fcf591d9
2 changed files with 10 additions and 0 deletions
+8
View File
@@ -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 )
+2
View File
@@ -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);
};