From 21ff1a044e06303be01ca1325d84c2f4c78fa9c8 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 18 Dec 2002 07:48:54 +0000 Subject: [PATCH] fix up sound firing --- stepmania/src/RageSound.cpp | 18 ++++++++++-------- stepmania/src/RageSoundManager.cpp | 5 +++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 64df16d56e..192532e5c1 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -98,21 +98,23 @@ RageSound::RageSound(const RageSound &cpy) LockMutex L(SOUNDMAN->lock); stream.Sample = NULL; - position = 0; - playing = false; - Loop = false; - speed = 1.0f; - stream.buf.reserve(internal_buffer_size); - AutoStop = cpy.AutoStop; - /* Copy some of it; don't copy the playing state. */ - big = cpy.big; full_buf = cpy.full_buf; + big = cpy.big; + AutoStop = cpy.AutoStop; + m_sFilePath = cpy.m_sFilePath; + m_StartSeconds = cpy.m_StartSeconds; + m_LengthSeconds = cpy.m_LengthSeconds; + Loop = cpy.Loop; + position = cpy.position; + playing = false; + speed = cpy.speed; if(big) { /* We can't copy the Sound_Sample, so load a new one. * Don't bother trying to load it in a small buffer. */ + stream.buf.reserve(internal_buffer_size); Load(cpy.GetLoadedFilePath(), false); } diff --git a/stepmania/src/RageSoundManager.cpp b/stepmania/src/RageSoundManager.cpp index eb0df1043c..53f5d35d7d 100644 --- a/stepmania/src/RageSoundManager.cpp +++ b/stepmania/src/RageSoundManager.cpp @@ -93,8 +93,13 @@ void RageSoundManager::PlayCopy( const RageSound &snd ) * std::basic_string happens to be refcounted). That's not too bad, * but we might do five of these in the same frame ... */ + RageSound *newsnd = new RageSound(snd); + /* PlayCopy's sounds must always stop on their own. */ + newsnd->SetLooping(true); + newsnd->SetAutoStop(true); + /* We're responsible for freeing it. */ owned_sounds.insert(newsnd);