SONGMAN API change.

This commit is contained in:
Steve Checkoway
2007-04-07 05:11:47 +00:00
parent 54035d6334
commit ef22ba5d57
12 changed files with 20 additions and 35 deletions
+1 -2
View File
@@ -74,8 +74,7 @@ void CatalogXml::Save( LoadingWindow *loading_window )
p2->AppendAttr( "Name", *sGroup );
int iNumSongsInGroup = 0;
vector<Song*> vpSongsInGroup;
SONGMAN->GetSongs( vpSongsInGroup, *sGroup );
const vector<Song*> &vpSongsInGroup = SONGMAN->GetSongs( *sGroup );
FOREACH_CONST( StepsType, vStepsTypesToShow, st )
{
XNode* p3 = p2->AppendChild( "StepsType" );
+2 -4
View File
@@ -228,10 +228,8 @@ void CourseUtil::AutogenEndlessFromGroup( const RString &sGroupName, Difficulty
e.stepsCriteria.m_difficulty = diff;
e.bSecret = true;
vector<Song*> vSongs;
SONGMAN->GetSongs( vSongs, e.songCriteria.m_sGroupName );
for( unsigned i = 0; i < vSongs.size(); ++i)
out.m_vEntries.push_back( e );
// Insert a copy of e for each song in the group.
out.m_vEntries.insert( out.m_vEntries.end(), SONGMAN->GetSongs(sGroupName).size(), e );
}
void CourseUtil::AutogenNonstopFromGroup( const RString &sGroupName, Difficulty diff, Course &out )
+1 -5
View File
@@ -54,11 +54,7 @@ void EditMenu::StripLockedStepsAndDifficulty( vector<StepsAndDifficulty> &v )
void EditMenu::GetSongsToShowForGroup( const RString &sGroup, vector<Song*> &vpSongsOut )
{
vpSongsOut.clear();
if( !SHOW_GROUPS.GetValue() )
SONGMAN->GetSongs( vpSongsOut );
else
SONGMAN->GetSongs( vpSongsOut, sGroup );
vpSongsOut = SONGMAN->GetSongs( SHOW_GROUPS.GetValue()? sGroup:GROUP_ALL );
switch( EDIT_MODE.GetValue() )
{
case EditMode_Practice:
+1 -1
View File
@@ -56,7 +56,7 @@ MusicBannerWheel::MusicBannerWheel()
m_ScrollingList.SetSpacing( BANNERSPACING );
this->AddChild( &m_ScrollingList );
SONGMAN->GetSongs( arraySongs, GAMESTATE->m_sPreferredSongGroup );
arraySongs = SONGMAN->GetSongs( GAMESTATE->m_sPreferredSongGroup );
// filter songs that we don't have enough stages to play
{
+1 -1
View File
@@ -324,7 +324,7 @@ void MusicWheel::GetSongList( vector<Song*> &arraySongs, SortOrder so, const RSt
SONGMAN->GetPopularSongs( apAllSongs, GAMESTATE->m_sPreferredSongGroup );
break;
default:
SONGMAN->GetSongs( apAllSongs, GAMESTATE->m_sPreferredSongGroup );
apAllSongs = SONGMAN->GetSongs( GAMESTATE->m_sPreferredSongGroup );
break;
}
+1 -2
View File
@@ -718,8 +718,7 @@ class OptionRowHandlerListSongsInCurrentSongGroup: public OptionRowHandlerList
{
virtual void LoadInternal( const Commands &cmds )
{
vector<Song*> vpSongs;
SONGMAN->GetSongs( vpSongs, GAMESTATE->m_sPreferredSongGroup );
const vector<Song*> &vpSongs = SONGMAN->GetSongs( GAMESTATE->m_sPreferredSongGroup );
if( GAMESTATE->m_pCurSong == NULL )
GAMESTATE->m_pCurSong.Set( vpSongs[0] );
+1 -1
View File
@@ -42,7 +42,7 @@ void ScreenJukebox::SetSong()
vSongs.push_back( pCourse->m_vEntries[i].pSong );
if ( vSongs.size() == 0 )
SONGMAN->GetSongs( vSongs, GAMESTATE->m_sPreferredSongGroup );
vSongs = SONGMAN->GetSongs( GAMESTATE->m_sPreferredSongGroup );
//
+1 -2
View File
@@ -27,8 +27,7 @@ void ScreenMusicScroll::Init()
{
ScreenAttract::Init();
vector<Song*> arraySongs;
SONGMAN->GetSongs( arraySongs );
vector<Song*> arraySongs = SONGMAN->GetSongs();
SongUtil::SortSongPointerArrayByTitle( arraySongs );
for( unsigned i=0; i < arraySongs.size(); i++ )
+1 -1
View File
@@ -57,7 +57,7 @@ void ScreenOptionsEditCourse::BeginScreen()
ASSERT( GAMESTATE->m_pCurCourse );
Course *pCourse = GAMESTATE->m_pCurCourse;
m_Original = *pCourse;
SONGMAN->GetSongs( m_vpDisplayedSongs );
m_vpDisplayedSongs = SONGMAN->GetSongs();
vector<OptionRowHandler*> vHands;
+5 -10
View File
@@ -35,11 +35,9 @@ static void FillSongsAndChoices( const RString &sSongGroup, vector<Song*> &vpSon
vpSongsOut.clear();
vsChoicesOut.clear();
if( sSongGroup.empty() )
SONGMAN->GetSongs( vpSongsOut );
else
SONGMAN->GetSongs( vpSongsOut, sSongGroup );
vpSongsOut.insert( vpSongsOut.begin(), NULL );
vpSongsOut.push_back( NULL );
const vector<Song *> vSongs = SONGMAN->GetSongs( sSongGroup.empty()? GROUP_ALL:sSongGroup );
vpSongsOut.insert( vpSongsOut.end(), vSongs.begin(), vSongs.end() );
FOREACH_CONST( Song*, vpSongsOut, s )
{
@@ -250,13 +248,10 @@ void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM )
if( pSong == NULL )
{
// Find the longest non-tutorial song.
vector<Song *> vSongs;
SONGMAN->GetSongs( vSongs );
const vector<Song *> &vSongs = SONGMAN->GetSongs();
float fLen = -1.f;
FOREACH( Song*, vSongs, i )
FOREACH_CONST( Song*, vSongs, i )
{
if( !(*i)->IsTutorial() && (*i)->m_fMusicLengthSeconds > fLen )
{
+1 -2
View File
@@ -32,8 +32,7 @@ void ScreenSelectGroup::Init()
ASSERT( PREFSMAN->m_bShowSelectGroup );
vector<Song*> aAllSongs;
SONGMAN->GetSongs( aAllSongs );
vector<Song*> aAllSongs = SONGMAN->GetSongs();
// Filter out Songs that can't be played by the current Style
for( int j=aAllSongs.size()-1; j>=0; j-- ) // foreach Song, back to front
+4 -4
View File
@@ -41,9 +41,8 @@ bool StepsCriteria::Matches( const Song *pSong, const Steps *pSteps ) const
void StepsUtil::GetAllMatching( const SongCriteria &soc, const StepsCriteria &stc, vector<SongAndSteps> &out )
{
const vector<Song*> &songs = soc.m_sGroupName.empty() ?
SONGMAN->GetAllSongs() :
SONGMAN->GetSongsInGroup(soc.m_sGroupName);
const RString &sGroupName = soc.m_sGroupName.empty()? GROUP_ALL:soc.m_sGroupName;
const vector<Song*> &songs = SONGMAN->GetSongs( sGroupName );
FOREACH_CONST( Song*, songs, so )
{
@@ -65,7 +64,8 @@ void StepsUtil::GetAllMatching( Song *pSong, const StepsCriteria &stc, vector<So
bool StepsUtil::HasMatching( const SongCriteria &soc, const StepsCriteria &stc )
{
const vector<Song*> &songs = soc.m_sGroupName.empty()? SONGMAN->GetAllSongs():SONGMAN->GetSongsInGroup( soc.m_sGroupName );
const RString &sGroupName = soc.m_sGroupName.empty()? GROUP_ALL:soc.m_sGroupName;
const vector<Song*> &songs = SONGMAN->GetSongs( sGroupName );
FOREACH_CONST( Song*, songs, so )
{