From 1cfda9a901a11088f883c4949eb83bd8b698f4f5 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 22 Jul 2005 22:17:34 +0000 Subject: [PATCH] remove unused PlayMusic overload --- stepmania/src/GameSoundManager.cpp | 39 ++++++++------------------ stepmania/src/GameSoundManager.h | 11 ++++++-- stepmania/src/MusicBannerWheel.cpp | 7 +++-- stepmania/src/ScreenEdit.cpp | 5 +++- stepmania/src/ScreenNetSelectMusic.cpp | 7 +++-- 5 files changed, 34 insertions(+), 35 deletions(-) diff --git a/stepmania/src/GameSoundManager.cpp b/stepmania/src/GameSoundManager.cpp index 19fae99fd6..dd035bb274 100644 --- a/stepmania/src/GameSoundManager.cpp +++ b/stepmania/src/GameSoundManager.cpp @@ -533,37 +533,19 @@ CString GameSoundManager::GetMusicPath() const return g_Playing->m_Music->GetLoadedFilePath(); } -/* This function should not touch the disk at all. */ -void GameSoundManager::PlayMusic( const CString &file, const CString &timing_file, bool force_loop, float start_sec, float length_sec, float fade_len, bool align_beat ) +void GameSoundManager::PlayMusic( + const CString &file, + const TimingData *pTiming, + bool force_loop, + float start_sec, + float length_sec, + float fade_len, + bool align_beat ) { -// LOG->Trace("play '%s' (current '%s')", file.c_str(), g_Playing->m_Music->GetLoadedFilePath().c_str()); + // LOG->Trace("play '%s' (current '%s')", file.c_str(), g_Playing->m_Music->GetLoadedFilePath().c_str()); MusicToPlay ToPlay; - ToPlay.file = file; - ToPlay.force_loop = force_loop; - ToPlay.start_sec = start_sec; - ToPlay.length_sec = length_sec; - ToPlay.fade_len = fade_len; - ToPlay.timing_file = timing_file; - ToPlay.align_beat = align_beat; - - /* If no timing file was specified, look for one in the same place as the music file. */ - if( ToPlay.timing_file == "" && file != "" ) - ToPlay.timing_file = SetExtension( file, "sm" ); - - /* Add the MusicToPlay to the g_MusicsToPlay queue. */ - g_Mutex->Lock(); - g_MusicsToPlay.push_back( ToPlay ); - g_Mutex->Broadcast(); - g_Mutex->Unlock(); -} - -void GameSoundManager::PlayMusic( const CString &file, const TimingData *pTiming, bool force_loop, float start_sec, float length_sec, float fade_len, bool align_beat ) -{ - MusicToPlay ToPlay; - - ToPlay.file = file; if( pTiming ) { @@ -571,7 +553,10 @@ void GameSoundManager::PlayMusic( const CString &file, const TimingData *pTiming ToPlay.timing_data = *pTiming; } else + { + /* If no timing file was specified, look for one in the same place as the music file. */ ToPlay.timing_file = SetExtension( file, "sm" ); + } ToPlay.force_loop = force_loop; ToPlay.start_sec = start_sec; diff --git a/stepmania/src/GameSoundManager.h b/stepmania/src/GameSoundManager.h index 68a2ef3245..f693740e89 100644 --- a/stepmania/src/GameSoundManager.h +++ b/stepmania/src/GameSoundManager.h @@ -17,9 +17,14 @@ public: ~GameSoundManager(); void Update( float fDeltaTime ); - void PlayMusic( const CString &file, bool force_loop = false, float start_sec = 0, float length_sec = -1, float fade_len = 0, bool align_beat = true ) { PlayMusic( file, "", force_loop, start_sec, length_sec, fade_len, align_beat ); } - void PlayMusic( const CString &file, const CString &timing_file, bool force_loop = false, float start_sec = 0, float length_sec = -1, float fade_len = 0, bool align_beat = true ); - void PlayMusic( const CString &file, const TimingData *pTiming, bool force_loop = false, float start_sec = 0, float length_sec = -1, float fade_len = 0, bool align_beat = true ); + void PlayMusic( + const CString &file, + const TimingData *pTiming = NULL, + bool force_loop = false, + float start_sec = 0, + float length_sec = -1, + float fade_len = 0, + bool align_beat = true ); void StopMusic() { PlayMusic(""); } void DimMusic( float fVolume, float fDurationSeconds ); CString GetMusicPath() const; diff --git a/stepmania/src/MusicBannerWheel.cpp b/stepmania/src/MusicBannerWheel.cpp index 2e8d0a5367..c7c499169f 100644 --- a/stepmania/src/MusicBannerWheel.cpp +++ b/stepmania/src/MusicBannerWheel.cpp @@ -358,9 +358,12 @@ void MusicBannerWheel::PlayMusicSample() { SOUND->StopMusic(); - SOUND->PlayMusic(pSong->GetMusicPath(), true, + SOUND->PlayMusic( + pSong->GetMusicPath(), + NULL, + true, pSong->m_fMusicSampleStartSeconds, - pSong->m_fMusicSampleLengthSeconds); + pSong->m_fMusicSampleLengthSeconds ); } } } diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 124c60b51c..6bf64b6460 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -751,7 +751,10 @@ void ScreenEdit::PlayTicks() void ScreenEdit::PlayPreviewMusic() { SOUND->PlayMusic(""); - SOUND->PlayMusic( m_pSong->GetMusicPath(), false, + SOUND->PlayMusic( + m_pSong->GetMusicPath(), + NULL, + false, m_pSong->m_fMusicSampleStartSeconds, m_pSong->m_fMusicSampleLengthSeconds, 1.5f ); diff --git a/stepmania/src/ScreenNetSelectMusic.cpp b/stepmania/src/ScreenNetSelectMusic.cpp index 9e6713cc0c..55dda2bc3d 100644 --- a/stepmania/src/ScreenNetSelectMusic.cpp +++ b/stepmania/src/ScreenNetSelectMusic.cpp @@ -557,9 +557,12 @@ void ScreenNetSelectMusic::MusicChanged() { SOUND->StopMusic(); - SOUND->PlayMusic(GAMESTATE->m_pCurSong->GetMusicPath(), true, + SOUND->PlayMusic( + GAMESTATE->m_pCurSong->GetMusicPath(), + NULL, + true, GAMESTATE->m_pCurSong->m_fMusicSampleStartSeconds, - GAMESTATE->m_pCurSong->m_fMusicSampleLengthSeconds); + GAMESTATE->m_pCurSong->m_fMusicSampleLengthSeconds ); } } }