diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 4d77c485db..75baf583f8 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -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 diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index eb03884508..23813b3abf 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -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 ); // diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 934181e5c0..1b390c57aa 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -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; } diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index 23280f19db..5d78db8bd3 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -97,12 +97,6 @@ void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuEle void ScreenAttract::StartPlayingMusic() { - if( !GAMESTATE->IsTimeToPlayAttractSounds() ) - { - SOUND->StopMusic(); - return; - } - ScreenWithMenuElements::StartPlayingMusic(); } diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index c20093094c..a6e31965e7 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -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() );