remove SOUNDMAN->PlayOnce
This commit is contained in:
@@ -249,6 +249,16 @@ static void StartMusic( MusicToPlay &ToPlay )
|
|||||||
g_Playing = NewMusic;
|
g_Playing = NewMusic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void DoPlayOnce( RString sPath )
|
||||||
|
{
|
||||||
|
/* We want this to start quickly, so don't try to prebuffer it. */
|
||||||
|
RageSound *pSound = new RageSound;
|
||||||
|
pSound->Load( sPath, false );
|
||||||
|
|
||||||
|
pSound->Play();
|
||||||
|
pSound->DeleteSelfWhenFinishedPlaying();
|
||||||
|
}
|
||||||
|
|
||||||
static void DoPlayOnceFromDir( RString sPath )
|
static void DoPlayOnceFromDir( RString sPath )
|
||||||
{
|
{
|
||||||
if( sPath == "" )
|
if( sPath == "" )
|
||||||
@@ -267,7 +277,7 @@ static void DoPlayOnceFromDir( RString sPath )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int index = RandomInt( arraySoundFiles.size( ));
|
int index = RandomInt( arraySoundFiles.size( ));
|
||||||
SOUNDMAN->PlayOnce( sPath + arraySoundFiles[index] );
|
DoPlayOnce( sPath + arraySoundFiles[index] );
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool SoundWaiting()
|
static bool SoundWaiting()
|
||||||
@@ -294,7 +304,7 @@ static void StartQueuedSounds()
|
|||||||
|
|
||||||
for( unsigned i = 0; i < aSoundsToPlayOnce.size(); ++i )
|
for( unsigned i = 0; i < aSoundsToPlayOnce.size(); ++i )
|
||||||
if( aSoundsToPlayOnce[i] != "" )
|
if( aSoundsToPlayOnce[i] != "" )
|
||||||
SOUNDMAN->PlayOnce( aSoundsToPlayOnce[i] );
|
DoPlayOnce( aSoundsToPlayOnce[i] );
|
||||||
|
|
||||||
for( unsigned i = 0; i < aSoundsToPlayOnceFromDir.size(); ++i )
|
for( unsigned i = 0; i < aSoundsToPlayOnceFromDir.size(); ++i )
|
||||||
DoPlayOnceFromDir( aSoundsToPlayOnceFromDir[i] );
|
DoPlayOnceFromDir( aSoundsToPlayOnceFromDir[i] );
|
||||||
|
|||||||
@@ -178,19 +178,6 @@ void RageSoundManager::AddLoadedSound( const RString &sPath_, RageSoundReader_Pr
|
|||||||
m_mapPreloadedSounds[sPath] = pSound->Copy();
|
m_mapPreloadedSounds[sPath] = pSound->Copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Don't hold the lock when we don't have to. We call this function from other
|
|
||||||
* threads, to avoid stalling the gameplay thread. */
|
|
||||||
void RageSoundManager::PlayOnce( RString sPath )
|
|
||||||
{
|
|
||||||
/* We want this to start quickly, so don't try to prebuffer it. */
|
|
||||||
RageSound *pSound = new RageSound;
|
|
||||||
pSound->Load( sPath, false );
|
|
||||||
|
|
||||||
pSound->Play();
|
|
||||||
pSound->DeleteSelfWhenFinishedPlaying();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RageSoundManager::SetMixVolume( float fMixVol )
|
void RageSoundManager::SetMixVolume( float fMixVol )
|
||||||
{
|
{
|
||||||
ASSERT_M( fMixVol >= 0 && fMixVol <= 1, ssprintf("%f",fMixVol) );
|
ASSERT_M( fMixVol >= 0 && fMixVol <= 1, ssprintf("%f",fMixVol) );
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ public:
|
|||||||
RageSoundReader *GetLoadedSound( const RString &sPath );
|
RageSoundReader *GetLoadedSound( const RString &sPath );
|
||||||
void AddLoadedSound( const RString &sPath, RageSoundReader_Preload *pSound );
|
void AddLoadedSound( const RString &sPath, RageSoundReader_Preload *pSound );
|
||||||
|
|
||||||
void PlayOnce( RString sPath );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
map<RString, RageSoundReader_Preload *> m_mapPreloadedSounds;
|
map<RString, RageSoundReader_Preload *> m_mapPreloadedSounds;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user