add pref PreferredSortUsesGroups

This commit is contained in:
Chris Danford
2005-05-09 17:33:22 +00:00
parent ec07a8efaf
commit 11b9427b9c
5 changed files with 9 additions and 10 deletions
+3 -1
View File
@@ -498,7 +498,9 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
{ {
case SORT_PREFERRED: case SORT_PREFERRED:
case SORT_ROULETTE: case SORT_ROULETTE:
SongUtil::SortSongPointerArrayByGroupAndDifficulty( arraySongs ); SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_EASY );
if( (bool)PREFSMAN->m_bPreferredSortUsesGroups )
stable_sort( arraySongs.begin(), arraySongs.end(), SongUtil::CompareSongPointersByGroup );
bUseSections = false; bUseSections = false;
break; break;
case SORT_GROUP: case SORT_GROUP:
+2 -1
View File
@@ -242,7 +242,8 @@ PrefsManager::PrefsManager() :
m_iMaxRecentScoresForMachine ( Options, "MaxRecentScoresForMachine", 100 ), m_iMaxRecentScoresForMachine ( Options, "MaxRecentScoresForMachine", 100 ),
m_iMaxRecentScoresForPlayer ( Options, "MaxRecentScoresForPlayer", 20 ), m_iMaxRecentScoresForPlayer ( Options, "MaxRecentScoresForPlayer", 20 ),
m_bAllowMultipleHighScoreWithSameName ( Options, "AllowMultipleHighScoreWithSameName", true ), m_bAllowMultipleHighScoreWithSameName ( Options, "AllowMultipleHighScoreWithSameName", true ),
m_bCelShadeModels ( Options, "CelShadeModels", false ) // Work-In-Progress.. disable by default. m_bCelShadeModels ( Options, "CelShadeModels", false ), // Work-In-Progress.. disable by default.
m_bPreferredSortUsesGroups ( Options, "PreferredSortUsesGroups", true )
{ {
Init(); Init();
ReadGlobalPrefsFromDisk(); ReadGlobalPrefsFromDisk();
+1
View File
@@ -225,6 +225,7 @@ public:
Preference<int> m_iMaxRecentScoresForPlayer; Preference<int> m_iMaxRecentScoresForPlayer;
Preference<bool> m_bAllowMultipleHighScoreWithSameName; Preference<bool> m_bAllowMultipleHighScoreWithSameName;
Preference<bool> m_bCelShadeModels; Preference<bool> m_bCelShadeModels;
Preference<bool> m_bPreferredSortUsesGroups;
/* experimental: force a specific update rate. This prevents big /* experimental: force a specific update rate. This prevents big
* animation jumps on frame skips. */ * animation jumps on frame skips. */
+1 -7
View File
@@ -163,17 +163,11 @@ void SongUtil::SortSongPointerArrayByGenre( vector<Song*> &vpSongsInOut )
stable_sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByGenre ); stable_sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByGenre );
} }
static int CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2) int SongUtil::CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2)
{ {
return pSong1->m_sGroupName < pSong2->m_sGroupName; return pSong1->m_sGroupName < pSong2->m_sGroupName;
} }
void SongUtil::SortSongPointerArrayByGroupAndDifficulty( vector<Song*> &vpSongsInOut )
{
SortSongPointerArrayByMeter( vpSongsInOut, DIFFICULTY_EASY );
stable_sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByGroup );
}
int CompareSongPointersByGroupAndTitle(const Song *pSong1, const Song *pSong2) int CompareSongPointersByGroupAndTitle(const Song *pSong1, const Song *pSong2)
{ {
const CString &sGroup1 = pSong1->m_sGroupName; const CString &sGroup1 = pSong1->m_sGroupName;
+2 -1
View File
@@ -19,7 +19,6 @@ namespace SongUtil
void SortSongPointerArrayByArtist( vector<Song*> &vpSongsInOut ); void SortSongPointerArrayByArtist( vector<Song*> &vpSongsInOut );
void SortSongPointerArrayByDisplayArtist( vector<Song*> &vpSongsInOut ); void SortSongPointerArrayByDisplayArtist( vector<Song*> &vpSongsInOut );
void SortSongPointerArrayByGenre( vector<Song*> &vpSongsInOut ); void SortSongPointerArrayByGenre( vector<Song*> &vpSongsInOut );
void SortSongPointerArrayByGroupAndDifficulty( vector<Song*> &vpSongsInOut );
void SortSongPointerArrayByGroupAndTitle( vector<Song*> &vpSongsInOut ); void SortSongPointerArrayByGroupAndTitle( vector<Song*> &vpSongsInOut );
void SortSongPointerArrayByNumPlays( vector<Song*> &vpSongsInOut, ProfileSlot slot, bool bDescending ); void SortSongPointerArrayByNumPlays( vector<Song*> &vpSongsInOut, ProfileSlot slot, bool bDescending );
void SortSongPointerArrayByNumPlays( vector<Song*> &vpSongsInOut, const Profile* pProfile, bool bDescending ); void SortSongPointerArrayByNumPlays( vector<Song*> &vpSongsInOut, const Profile* pProfile, bool bDescending );
@@ -27,6 +26,8 @@ namespace SongUtil
CString GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so ); CString GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so );
void SortSongPointerArrayBySectionName( vector<Song*> &vpSongsInOut, SortOrder so ); void SortSongPointerArrayBySectionName( vector<Song*> &vpSongsInOut, SortOrder so );
void SortByMostRecentlyPlayedForMachine( vector<Song*> &vpSongsInOut ); void SortByMostRecentlyPlayedForMachine( vector<Song*> &vpSongsInOut );
int CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2);
} }
class SongID class SongID