From 45ee7a9b1d6417a5777c22a0022b2d794ab0422a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 19 Jan 2003 10:14:46 +0000 Subject: [PATCH] use RSM->PlayMusic for music. This fixes credits and menu music playing into the attract. --- stepmania/src/ScreenAttract.cpp | 12 ++++++++---- stepmania/src/ScreenAttract.h | 2 -- stepmania/src/ScreenTitleMenu.cpp | 2 -- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index 180fc842ba..caa00bf8d5 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -54,8 +54,7 @@ ScreenAttract::ScreenAttract( CString sMetricName, CString sElementName ) m_soundStart.Load( THEME->GetPathTo("Sounds","menu start") ); - m_soundMusic.Load( THEME->GetPathTo("Sounds",m_sElementName + " music") ); - m_soundMusic.Play(); + SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds",m_sElementName + " music"), false ); GAMESTATE->m_bPlayersCanJoin = true; @@ -101,7 +100,7 @@ void ScreenAttract::Input( const DeviceInput& DeviceI, const InputEventType type break; case MENU_BUTTON_COIN: Screen::MenuCoin( MenuI.player ); // increment coins, play sound - m_soundMusic.Stop(); + SOUNDMAN->music->StopPlaying(); ::Sleep( 200 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; @@ -116,7 +115,7 @@ void ScreenAttract::Input( const DeviceInput& DeviceI, const InputEventType type // fall through case PrefsManager::COIN_FREE: case PrefsManager::COIN_HOME: - m_soundMusic.Stop(); + SOUNDMAN->music->StopPlaying(); SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","insert coin") ); ::Sleep( 200 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); @@ -145,6 +144,11 @@ void ScreenAttract::HandleScreenMessage( const ScreenMessage SM ) m_Fade.CloseWipingRight( SM_GoToNextScreen ); break; case SM_GoToNextScreen: + /* XXX: Look at the def of the screen we're going to; if it has a + * music theme element and it's the same as the one we're playing + * now, don't stop. (However, if we're going to interrupt it + * when we fade in, it's cleaner to stop it before we fade out.) */ + SOUNDMAN->PlayMusic( "" ); SCREENMAN->SetNewScreen( NEXT_SCREEN ); break; } diff --git a/stepmania/src/ScreenAttract.h b/stepmania/src/ScreenAttract.h index 3902930c3c..d9fb83ac89 100644 --- a/stepmania/src/ScreenAttract.h +++ b/stepmania/src/ScreenAttract.h @@ -40,8 +40,6 @@ protected: BGAnimation m_Background; TransitionFade m_Fade; RandomSample m_soundStart; - - RageSound m_soundMusic; }; diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 127f3b2e3e..ca63352406 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -122,8 +122,6 @@ ScreenTitleMenu::ScreenTitleMenu() for( int i=0; iPlayMusic( THEME->GetPathTo("Sounds","title menu music") );