diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 9de9beed7e..8159b99910 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -47,6 +47,7 @@ RageSoundParams::RageSoundParams(): m_fFadeInSeconds = 0; m_fFadeOutSeconds = 0; m_Volume = 1.0f; + m_fAttractVolume = 1.0f; m_fPitch = 1.0f; m_fSpeed = 1.0f; StopMode = M_AUTO; @@ -350,6 +351,9 @@ void RageSound::StartPlaying() m_bPlaying = true; + /* Save the attract volume, so changes don't affect previously played + * sounds. */ + m_Param.m_fAttractVolume = SOUNDMAN->GetVolumeOfNonCriticalSounds(); ApplyParams(); /* Don't lock while calling SOUNDMAN driver calls. */ @@ -585,7 +589,7 @@ void RageSound::ApplyParams() float fVolume = m_Param.m_Volume * SOUNDMAN->GetMixVolume(); if( !m_Param.m_bIsCriticalSound ) - fVolume *= SOUNDMAN->GetVolumeOfNonCriticalSounds(); + fVolume *= m_Param.m_fAttractVolume; m_pSource->SetProperty( "Volume", fVolume ); switch( GetStopMode() ) diff --git a/stepmania/src/RageSound.h b/stepmania/src/RageSound.h index 7beebd1c9d..e4d6938b51 100644 --- a/stepmania/src/RageSound.h +++ b/stepmania/src/RageSound.h @@ -39,6 +39,7 @@ struct RageSoundParams float m_fFadeOutSeconds; float m_Volume; // multiplies with SOUNDMAN->GetMixVolume() + float m_fAttractVolume; // multiplies with m_Volume /* Number of samples input and output when changing speed. Currently, * this is either 1/1, 5/4 or 4/5. */