add RageSound::PlayCopy
This commit is contained in:
@@ -417,7 +417,7 @@ void RageSound::Play( const RageSoundParams *pParams )
|
|||||||
|
|
||||||
if( IsPlaying() )
|
if( IsPlaying() )
|
||||||
{
|
{
|
||||||
SOUNDMAN->PlayCopyOfSound( *this, pParams );
|
PlayCopy( pParams );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,6 +427,17 @@ void RageSound::Play( const RageSoundParams *pParams )
|
|||||||
StartPlaying();
|
StartPlaying();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RageSound::PlayCopy( const RageSoundParams *pParams ) const
|
||||||
|
{
|
||||||
|
RageSound *pSound = new RageSound( *this );
|
||||||
|
|
||||||
|
if( pParams )
|
||||||
|
pSound->SetParams( *pParams );
|
||||||
|
|
||||||
|
pSound->StartPlaying();
|
||||||
|
pSound->DeleteSelfWhenFinishedPlaying();
|
||||||
|
}
|
||||||
|
|
||||||
void RageSound::Stop()
|
void RageSound::Stop()
|
||||||
{
|
{
|
||||||
StopPlaying();
|
StopPlaying();
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ public:
|
|||||||
RString GetError() const { return m_sError; }
|
RString GetError() const { return m_sError; }
|
||||||
|
|
||||||
void Play( const RageSoundParams *params=NULL );
|
void Play( const RageSoundParams *params=NULL );
|
||||||
|
void PlayCopy( const RageSoundParams *pParams = NULL ) const;
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
||||||
/* Cleanly pause or unpause the sound. If the sound wasn't already playing,
|
/* Cleanly pause or unpause the sound. If the sound wasn't already playing,
|
||||||
|
|||||||
Reference in New Issue
Block a user