From 893921491228a281e605a8022104d00740af4cb5 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 7 Apr 2004 04:21:09 +0000 Subject: [PATCH] use SoundIsFinishedPlaying; simplify --- .../RageSoundDriver_Generic_Software.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp index fa02ad4349..a79c0070d4 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp @@ -218,7 +218,8 @@ void RageSound_Generic_Software::Update(float delta) LOG->Trace("finishing sound %i", i); /* This sound is done. */ - sounds[i].snd->StopPlaying(); + sounds[i].state = sound::STOPPED; + sounds[i].snd->SoundIsFinishedPlaying(); } } @@ -269,23 +270,15 @@ void RageSound_Generic_Software::StopMixing( RageSoundBase *snd ) return; } - /* If we're already in STOPPED or HALTING, there's nothing to do. */ + /* If we're already in STOPPED, there's nothing to do. */ if( sounds[i].state == sound::STOPPED ) { - LOG->Trace( "not stopping a sound because it's in STOPPED or HALTING" ); + LOG->Trace( "not stopping a sound because it's already in STOPPED" ); return; } - if( sounds[i].state == sound::STOPPING && sounds[i].buffer.num_readable() == 0 ) - { - /* The sound is finished and already flushed. */ - sounds[i].state = sound::STOPPED; - } - else - { - /* Tell the mixing thread to flush the buffer. */ - sounds[i].state = sound::HALTING; - } + /* Tell the mixing thread to flush the buffer. */ + sounds[i].state = sound::HALTING; /* Invalidate the snd pointer to guarantee we don't make any further references to * it. Once this call returns, the sound may no longer exist. */