split out LoadAutoplaySoundsInto

This commit is contained in:
Glenn Maynard
2006-12-10 04:42:39 +00:00
parent 3859d3b7bc
commit 0eaab20da5
2 changed files with 19 additions and 10 deletions
+16 -10
View File
@@ -29,20 +29,12 @@ void AutoKeysounds::Load( PlayerNumber pn, const NoteData& ndAutoKeysoundsOnly )
m_ndAutoKeysoundsOnly[pn] = ndAutoKeysoundsOnly;
}
void AutoKeysounds::FinishLoading()
void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain )
{
m_sSound.Unload();
/* Load the BGM. */
RageSoundReader_Chain *pChain = new RageSoundReader_Chain;
Song* pSong = GAMESTATE->m_pCurSong;
pChain->SetPreferredSampleRate( SOUNDMAN->GetDriverSampleRate(44100) );
pChain->AddSound( pChain->LoadSound(pSong->GetMusicPath()), 0, 0 );
//
// Load sounds.
//
Song* pSong = GAMESTATE->m_pCurSong;
RString sSongDir = pSong->GetSongDir();
/*
m_vKeysounds.clear();
@@ -122,7 +114,21 @@ void AutoKeysounds::FinishLoading()
}
}
}
}
void AutoKeysounds::FinishLoading()
{
m_sSound.Unload();
/* Load the BGM. */
RageSoundReader_Chain *pChain = new RageSoundReader_Chain;
Song* pSong = GAMESTATE->m_pCurSong;
pChain->SetPreferredSampleRate( SOUNDMAN->GetDriverSampleRate(44100) );
pChain->AddSound( pChain->LoadSound(pSong->GetMusicPath()), 0, 0 );
LoadAutoplaySoundsInto( pChain );
pChain->Finish();
/* Load a pitch shifter for the whole sound. */
+3
View File
@@ -7,6 +7,7 @@
#include "PlayerNumber.h"
#include "RageSound.h"
class RageSoundReader_Chain;
class AutoKeysounds
{
public:
@@ -16,6 +17,8 @@ public:
RageSound *GetSound() { return &m_sSound; }
protected:
void LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain );
NoteData m_ndAutoKeysoundsOnly[NUM_PLAYERS];
vector<RageSound> m_vKeysounds;
RageSound m_sSound;