RageSound handles SOUNDMAN->playing_sounds itself

This commit is contained in:
Glenn Maynard
2004-01-14 08:00:51 +00:00
parent e382b89cc2
commit bbbb76d551
3 changed files with 5 additions and 5 deletions
+2
View File
@@ -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();
-3
View File
@@ -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.
+3 -2
View File
@@ -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;
@@ -59,6 +57,9 @@ public:
* 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 );
};