From f598a50e6fc9d74a142dbe1c28c2228d8a22ea83 Mon Sep 17 00:00:00 2001 From: Andrew Livy Date: Mon, 15 Sep 2003 22:21:18 +0000 Subject: [PATCH] MusicBannerWheel Comparison Fixes --- stepmania/src/MusicBannerWheel.cpp | 11 ++++++++--- stepmania/src/RageSounds.cpp | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/stepmania/src/MusicBannerWheel.cpp b/stepmania/src/MusicBannerWheel.cpp index 277c39b55c..d1043ce0ae 100644 --- a/stepmania/src/MusicBannerWheel.cpp +++ b/stepmania/src/MusicBannerWheel.cpp @@ -334,9 +334,14 @@ void MusicBannerWheel::PlayMusicSample() Song* pSong = GetSelectedSong(); if( pSong && pSong->HasMusic() ) { - SOUND->PlayMusic(pSong->GetMusicPath(), true, - pSong->m_fMusicSampleStartSeconds, - pSong->m_fMusicSampleLengthSeconds); + if(SOUND->GetMusicPath().CompareNoCase(pSong->GetMusicPath())) // dont play the same sound over and over + { + + SOUND->StopMusic(); + SOUND->PlayMusic(pSong->GetMusicPath(), true, + pSong->m_fMusicSampleStartSeconds, + pSong->m_fMusicSampleLengthSeconds); + } } } diff --git a/stepmania/src/RageSounds.cpp b/stepmania/src/RageSounds.cpp index 640e10fd71..693a1b1ba8 100644 --- a/stepmania/src/RageSounds.cpp +++ b/stepmania/src/RageSounds.cpp @@ -26,6 +26,8 @@ CString RageSounds::GetMusicPath() const void RageSounds::PlayMusic(CString file, bool force_loop, float start_sec, float length_sec, float fade_len) { // LOG->Trace("play '%s' (current '%s')", file.c_str(), music->GetLoadedFilePath().c_str()); + CString loaded = music->GetLoadedFilePath(); + if(music->IsPlaying()) { if( !music->GetLoadedFilePath().CompareNoCase(file) )