[MusicWheel] Added ShowSectionsInBPMSort and ShowSectionsInLengthSort metrics.

This commit is contained in:
AJ Kelly
2011-05-14 19:27:25 -05:00
parent f845dbc232
commit 0fc49d9da9
3 changed files with 29 additions and 11 deletions
+4
View File
@@ -8,6 +8,10 @@ ________________________________________________________________________________
StepMania 5.0 $NEXT | 20110xyy
--------------------------------------------------------------------------------
2011/05/14
----------
* [MusicWheel] Added ShowSectionsInBPMSort and ShowSectionsInLengthSort metrics. [AJ]
2011/05/11
----------
* [GameSoundManager] Added PlayAnnouncer Lua binding. [AJ]
+2
View File
@@ -857,7 +857,9 @@ ShowRoulette=true
ShowRandom=false
ShowPortal=false
ShowSectionsInBPMSort=true
SortBPMDivision=20
ShowSectionsInLengthSort=true
SortLengthDivision=5
MostPlayedSongsToShow=30
+12
View File
@@ -21,6 +21,8 @@
ThemeMetric<int> SORT_BPM_DIVISION ( "MusicWheel", "SortBPMDivision" );
ThemeMetric<int> SORT_LENGTH_DIVISION ( "MusicWheel", "SortLengthDivision" );
ThemeMetric<bool> SHOW_SECTIONS_IN_BPM_SORT ( "MusicWheel", "ShowSectionsInBPMSort" );
ThemeMetric<bool> SHOW_SECTIONS_IN_LENGTH_SORT ( "MusicWheel", "ShowSectionsInLengthSort" );
bool SongCriteria::Matches( const Song *pSong ) const
{
@@ -597,6 +599,8 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
return pSong->m_sGenre;
return SORT_NOT_AVAILABLE.GetValue();
case SORT_BPM:
{
if( SHOW_SECTIONS_IN_BPM_SORT )
{
const int iBPMGroupSize = SORT_BPM_DIVISION;
DisplayBpms bpms;
@@ -605,7 +609,12 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize) - 1;
return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM);
}
else
return RString();
}
case SORT_LENGTH:
{
if( SHOW_SECTIONS_IN_LENGTH_SORT )
{
const int iSortLengthSize = SORT_LENGTH_DIVISION;
int iMaxLength = (int)pSong->m_fMusicLengthSeconds;
@@ -613,6 +622,9 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
int iMinLength = iMaxLength - (iSortLengthSize-1);
return ssprintf( "%s-%s", SecondsToMMSS(iMinLength).c_str(), SecondsToMMSS(iMaxLength).c_str() );
}
else
return RString();
}
case SORT_POPULARITY:
case SORT_RECENT:
return RString();