use RSM->PlayMusic for music. This fixes credits and menu music

playing into the attract.
This commit is contained in:
Glenn Maynard
2003-01-19 10:14:46 +00:00
parent 86d71eaf4e
commit 45ee7a9b1d
3 changed files with 8 additions and 8 deletions
+8 -4
View File
@@ -54,8 +54,7 @@ ScreenAttract::ScreenAttract( CString sMetricName, CString sElementName )
m_soundStart.Load( THEME->GetPathTo("Sounds","menu start") ); m_soundStart.Load( THEME->GetPathTo("Sounds","menu start") );
m_soundMusic.Load( THEME->GetPathTo("Sounds",m_sElementName + " music") ); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds",m_sElementName + " music"), false );
m_soundMusic.Play();
GAMESTATE->m_bPlayersCanJoin = true; GAMESTATE->m_bPlayersCanJoin = true;
@@ -101,7 +100,7 @@ void ScreenAttract::Input( const DeviceInput& DeviceI, const InputEventType type
break; break;
case MENU_BUTTON_COIN: case MENU_BUTTON_COIN:
Screen::MenuCoin( MenuI.player ); // increment coins, play sound Screen::MenuCoin( MenuI.player ); // increment coins, play sound
m_soundMusic.Stop(); SOUNDMAN->music->StopPlaying();
::Sleep( 200 ); // do a little pause, like the arcade does ::Sleep( 200 ); // do a little pause, like the arcade does
SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
break; break;
@@ -116,7 +115,7 @@ void ScreenAttract::Input( const DeviceInput& DeviceI, const InputEventType type
// fall through // fall through
case PrefsManager::COIN_FREE: case PrefsManager::COIN_FREE:
case PrefsManager::COIN_HOME: case PrefsManager::COIN_HOME:
m_soundMusic.Stop(); SOUNDMAN->music->StopPlaying();
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","insert coin") ); SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","insert coin") );
::Sleep( 200 ); // do a little pause, like the arcade does ::Sleep( 200 ); // do a little pause, like the arcade does
SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
@@ -145,6 +144,11 @@ void ScreenAttract::HandleScreenMessage( const ScreenMessage SM )
m_Fade.CloseWipingRight( SM_GoToNextScreen ); m_Fade.CloseWipingRight( SM_GoToNextScreen );
break; break;
case SM_GoToNextScreen: 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 ); SCREENMAN->SetNewScreen( NEXT_SCREEN );
break; break;
} }
-2
View File
@@ -40,8 +40,6 @@ protected:
BGAnimation m_Background; BGAnimation m_Background;
TransitionFade m_Fade; TransitionFade m_Fade;
RandomSample m_soundStart; RandomSample m_soundStart;
RageSound m_soundMusic;
}; };
-2
View File
@@ -123,8 +123,6 @@ ScreenTitleMenu::ScreenTitleMenu()
LoseFocus( i ); LoseFocus( i );
GainFocus( m_TitleMenuChoice ); GainFocus( m_TitleMenuChoice );
m_soundMusic.Stop();
SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","title menu music") ); SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","title menu music") );
this->SendScreenMessage( SM_PlayComment, SECONDS_BETWEEN_COMMENTS); this->SendScreenMessage( SM_PlayComment, SECONDS_BETWEEN_COMMENTS);