RageSound handles SOUNDMAN->playing_sounds itself
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -18,8 +18,6 @@ class RageSoundManager
|
||||
/* Set of sounds that are finished and should be deleted. */
|
||||
set<RageSound *> sounds_to_delete;
|
||||
|
||||
set<RageSound *> 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<RageSound *> all_sounds;
|
||||
|
||||
/* RageSound adds and removes itself to this. */
|
||||
set<RageSound *> playing_sounds;
|
||||
|
||||
static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume);
|
||||
static void AttenuateBuf( Sint16 *buf, int samples, float vol );
|
||||
|
||||
Reference in New Issue
Block a user