remove RageSoundManager::PlaySound

This commit is contained in:
Glenn Maynard
2007-01-18 08:34:52 +00:00
parent 4eb20f1e79
commit 32a9a47f87
3 changed files with 11 additions and 17 deletions
+11 -2
View File
@@ -412,10 +412,19 @@ void RageSound::Play( const RageSoundParams *pParams )
if( m_pSource == NULL ) if( m_pSource == NULL )
{ {
LOG->Warn( "RageSound::Play: sound not loaded" ); 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() void RageSound::Stop()
-14
View File
@@ -144,20 +144,6 @@ int RageSoundManager::GetDriverSampleRate() const
return m_pDriver->GetSampleRate(); 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 *RageSoundManager::PlayCopyOfSound( RageSound &snd, const RageSoundParams *pParams )
{ {
RageSound *pSound = new RageSound( snd ); RageSound *pSound = new RageSound( snd );
-1
View File
@@ -47,7 +47,6 @@ public:
void PlayOnce( RString sPath ); void PlayOnce( RString sPath );
RageSound *PlaySound( RageSound &snd, const RageSoundParams *params = NULL );
RageSound *PlayCopyOfSound( RageSound &snd, const RageSoundParams *params = NULL ); RageSound *PlayCopyOfSound( RageSound &snd, const RageSoundParams *params = NULL );
private: private: