From 9809192ee25f17babb08469514d746575c2b9dee Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 7 Jun 2004 05:37:00 +0000 Subject: [PATCH] fix m not restarting sample music in the editor --- stepmania/src/RageSounds.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stepmania/src/RageSounds.cpp b/stepmania/src/RageSounds.cpp index b4dbcc49cc..43c86ec0a8 100644 --- a/stepmania/src/RageSounds.cpp +++ b/stepmania/src/RageSounds.cpp @@ -267,8 +267,21 @@ static void StartQueuedSounds() while( g_MusicsToPlay.read( &pMusic, 1 ) ) { /* Don't bother starting this music if there's another one in the queue after it. */ + /* Actually, it's a little trickier: the editor gives us a stop and then a sound in + * quick succession; if we ignore the stop, we won't rewind the sound if it was + * already playing. We don't want to waste time loading a sound if it's going + * to be replaced immediately, though. So, if we have more music in the queue, + * then forcibly stop the current sound. */ if( !g_MusicsToPlay.num_readable() ) StartMusic( *pMusic ); + else + { + CHECKPOINT; + LockMutex L( *g_Mutex ); + if( g_Playing->m_Music->IsPlaying() ) + g_Playing->m_Music->StopPlaying(); + g_Playing->m_Music->Unload(); + } delete pMusic; } }