mute attract sounds inside of RageSound and don't mute everywhere that a sound might possibly be used in an attract screen

This commit is contained in:
Chris Danford
2005-10-03 23:54:40 +00:00
parent f02877b54f
commit a1cc399f3f
5 changed files with 13 additions and 10 deletions
+4 -1
View File
@@ -1647,8 +1647,11 @@ bool GameState::OneIsHot() const
return false;
}
bool GameState::IsTimeToPlayAttractSounds() const
bool GameState::IsTimeToPlaySounds() const
{
if( !GAMESTATE->m_bDemonstrationOrJukebox )
return true;
// m_iNumTimesThroughAttract will be -1 from the first attract screen after
// the end of a game until the next time FIRST_ATTRACT_SCREEN is reached.
// Play attract sounds for this sort span of time regardless of
+1 -1
View File
@@ -267,7 +267,7 @@ public:
// Attract stuff
//
int m_iNumTimesThroughAttract; // negative means play regardless of m_iAttractSoundFrequency setting
bool IsTimeToPlayAttractSounds() const;
bool IsTimeToPlaySounds() const;
void VisitAttractScreen( const CString sScreenName );
//
+7 -1
View File
@@ -29,6 +29,7 @@
#include "PrefsManager.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "RageSoundUtil.h"
#include "GameState.h"
#include "RageSoundReader_Preload.h"
#include "RageSoundReader_Resample.h"
@@ -51,6 +52,10 @@ RageSoundParams::RageSoundParams():
m_LengthSeconds = -1;
m_FadeLength = 0;
m_Volume = 1.0f;
if( !GAMESTATE->IsTimeToPlaySounds() )
m_Volume = 0;
m_Balance = 0; // center
speed_input_samples = speed_output_samples = 1;
m_bAccurateSync = false;
@@ -883,7 +888,8 @@ float RageSound::GetVolume() const
float RageSound::GetAbsoluteVolume() const
{
float f = m_Param.m_Volume * SOUNDMAN->GetMixVolume();
float f = m_Param.m_Volume;
f *= SOUNDMAN->GetMixVolume();
return f;
}
-6
View File
@@ -97,12 +97,6 @@ void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuEle
void ScreenAttract::StartPlayingMusic()
{
if( !GAMESTATE->IsTimeToPlayAttractSounds() )
{
SOUND->StopMusic();
return;
}
ScreenWithMenuElements::StartPlayingMusic();
}
+1 -1
View File
@@ -1374,7 +1374,7 @@ float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusi
p.m_StartSecond = fStartSecond;
// Silence music if not playing attract sounds in demonstration.
if( GAMESTATE->m_bDemonstrationOrJukebox && !GAMESTATE->IsTimeToPlayAttractSounds() )
if( !GAMESTATE->IsTimeToPlaySounds() )
p.m_Volume = 0;
ASSERT( !m_pSoundMusic->IsPlaying() );