From 47825d5540ee5b36f28c23a9bb10f53f388229e3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 22 Jan 2004 07:00:44 +0000 Subject: [PATCH] fix silent demo music --- stepmania/src/ScreenDemonstration.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index 799dc4868e..b10669b90c 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -47,6 +47,12 @@ bool PrepareForDemonstration() // always return true. GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE; + /* If needed, turn sound off. We need to do this before the ScreenGameplay ctor, + * since changes to sound volume aren't guaranteed to take effect if done *after* + * the sound starts playing. */ + if( !GAMESTATE->IsTimeToPlayAttractSounds() ) + SOUNDMAN->SetPrefs( 0 ); // silent + return true; } @@ -73,9 +79,6 @@ ScreenDemonstration::ScreenDemonstration( CString sName ) : ScreenJukebox( sName m_DancingState = STATE_DANCING; this->PostScreenMessage( SM_BeginFadingOut, SECONDS_TO_SHOW ); - - if( !GAMESTATE->IsTimeToPlayAttractSounds() ) - SOUNDMAN->SetPrefs( 0 ); // silent } ScreenDemonstration::~ScreenDemonstration()