From ced0a0c6e99c93f212da33ddad7a7b812e123357 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 13 Oct 2005 22:07:40 +0000 Subject: [PATCH] fix transition sounds playing when attract sounds are off --- stepmania/src/RageSound.cpp | 9 ++++++--- stepmania/src/ScreenManager.cpp | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index c0e29982b0..f99351bd59 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -591,6 +591,9 @@ void RageSound::StartPlaying() SOUNDMAN->StartMixing( this ); + if( !m_Param.m_bIsCriticalSound && SOUNDMAN->GetPlayOnlyCriticalSounds() ) + m_Param.m_Volume = 0; + // LOG->Trace("StartPlaying %p finished (%s)", this, this->GetLoadedFilePath().c_str()); } @@ -871,7 +874,9 @@ void RageSoundParams::SetPlaybackRate( float fSpeed ) { speed_input_samples = 1; speed_output_samples = 1; - } else { + } + else + { /* Approximate it to the nearest tenth. */ speed_input_samples = int( roundf(fSpeed * 10) ); speed_output_samples = 10; @@ -913,8 +918,6 @@ RageTimer RageSound::GetStartTime() const void RageSound::SetParams( const RageSoundParams &p ) { m_Param = p; - if( !m_Param.m_bIsCriticalSound && SOUNDMAN->GetPlayOnlyCriticalSounds() ) - m_Param.m_Volume = 0; } RageSoundParams::StopMode_t RageSound::GetStopMode() const diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 17c51b2587..c16365c292 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -807,7 +807,9 @@ void ScreenManager::ZeroNextUpdate() void ScreenManager::PlayInvalidSound() { - m_soundInvalid.Play(); + RageSoundParams p; + p.m_bIsCriticalSound = true; + m_soundInvalid.Play( &p ); } /* Always play these sounds, even if we're in a silent attract loop. */