Add RageSoundManager::GetMusicPath.
RageSoundManager::PlayMusic: unload sounds when we stop playing.
This commit is contained in:
@@ -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)
|
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());
|
// 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 is blank, just stop. */
|
||||||
if(file.empty())
|
if(file.empty())
|
||||||
|
{
|
||||||
|
music->Unload();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
music->Load( file, false );
|
music->Load( file, false );
|
||||||
if( force_loop )
|
if( force_loop )
|
||||||
|
|||||||
@@ -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 PlayMusic(CString file, bool force_loop = false, float start_sec = -1, float length_sec = -1, float fade_len = 0);
|
||||||
void StopMusic() { PlayMusic(""); }
|
void StopMusic() { PlayMusic(""); }
|
||||||
|
CString GetMusicPath() const;
|
||||||
|
|
||||||
static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume);
|
static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user