diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 5e4357b9c4..bab2813cbb 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -412,10 +412,19 @@ void RageSound::Play( const RageSoundParams *pParams ) if( m_pSource == NULL ) { LOG->Warn( "RageSound::Play: sound not loaded" ); - return NULL; + return; } - SOUNDMAN->PlaySound( *this, pParams ); + if( IsPlaying() ) + { + SOUNDMAN->PlayCopyOfSound( *this, pParams ); + return; + } + + if( pParams ) + SetParams( *pParams ); + + StartPlaying(); } void RageSound::Stop() diff --git a/stepmania/src/RageSoundManager.cpp b/stepmania/src/RageSoundManager.cpp index cbed26f988..d49900da03 100644 --- a/stepmania/src/RageSoundManager.cpp +++ b/stepmania/src/RageSoundManager.cpp @@ -144,20 +144,6 @@ int RageSoundManager::GetDriverSampleRate() const return m_pDriver->GetSampleRate(); } -/* The return value of PlaySound and PlayCopyOfSound is only valid in the main - * thread, until the next call to Update(). After that, it may be deleted. */ -RageSound *RageSoundManager::PlaySound( RageSound &snd, const RageSoundParams *params ) -{ - if( snd.IsPlaying() ) - return PlayCopyOfSound( snd, params ); - - if( params ) - snd.SetParams( *params ); - - snd.StartPlaying(); - return &snd; -} - RageSound *RageSoundManager::PlayCopyOfSound( RageSound &snd, const RageSoundParams *pParams ) { RageSound *pSound = new RageSound( snd ); diff --git a/stepmania/src/RageSoundManager.h b/stepmania/src/RageSoundManager.h index 0f56cab6e6..1db7c72e7a 100644 --- a/stepmania/src/RageSoundManager.h +++ b/stepmania/src/RageSoundManager.h @@ -47,7 +47,6 @@ public: void PlayOnce( RString sPath ); - RageSound *PlaySound( RageSound &snd, const RageSoundParams *params = NULL ); RageSound *PlayCopyOfSound( RageSound &snd, const RageSoundParams *params = NULL ); private: