diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 639d242122..e67d3e9153 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -520,6 +520,7 @@ void RageSound::StartPlaying() /* Tell the sound manager to start mixing us. */ playing = true; SOUNDMAN->StartMixing(this); + SOUNDMAN->playing_sounds.insert( this ); } void RageSound::StopPlaying() @@ -531,6 +532,7 @@ void RageSound::StopPlaying() /* Tell the sound manager to stop mixing this sound. */ SOUNDMAN->StopMixing(this); + SOUNDMAN->playing_sounds.erase( this ); playing = false; pos_map.clear(); diff --git a/stepmania/src/RageSoundManager.cpp b/stepmania/src/RageSoundManager.cpp index f708ed1793..bfbf75dcf7 100644 --- a/stepmania/src/RageSoundManager.cpp +++ b/stepmania/src/RageSoundManager.cpp @@ -46,14 +46,11 @@ RageSoundManager::~RageSoundManager() void RageSoundManager::StartMixing(RageSound *snd) { - playing_sounds.insert(snd); driver->StartMixing(snd); } void RageSoundManager::StopMixing(RageSound *snd) { - playing_sounds.erase(snd); - driver->StopMixing(snd); /* The sound is finished, and should be deleted if it's in owned_sounds. diff --git a/stepmania/src/RageSoundManager.h b/stepmania/src/RageSoundManager.h index bbb1b283fa..9898e83932 100644 --- a/stepmania/src/RageSoundManager.h +++ b/stepmania/src/RageSoundManager.h @@ -18,8 +18,6 @@ class RageSoundManager /* Set of sounds that are finished and should be deleted. */ set sounds_to_delete; - set playing_sounds; - struct FakeSound { float begin; int samples_read; @@ -58,6 +56,9 @@ public: /* A list of all sounds that currently exist. RageSound adds and removes * itself to this. */ set all_sounds; + + /* RageSound adds and removes itself to this. */ + set playing_sounds; static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume); static void AttenuateBuf( Sint16 *buf, int samples, float vol );