[MusicWheel] Added ShowSectionsInBPMSort and ShowSectionsInLengthSort metrics.
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -857,7 +857,9 @@ ShowRoulette=true
|
||||
ShowRandom=false
|
||||
ShowPortal=false
|
||||
|
||||
ShowSectionsInBPMSort=true
|
||||
SortBPMDivision=20
|
||||
ShowSectionsInLengthSort=true
|
||||
SortLengthDivision=5
|
||||
|
||||
MostPlayedSongsToShow=30
|
||||
|
||||
+23
-11
@@ -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
|
||||
{
|
||||
@@ -598,20 +600,30 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
|
||||
return SORT_NOT_AVAILABLE.GetValue();
|
||||
case SORT_BPM:
|
||||
{
|
||||
const int iBPMGroupSize = SORT_BPM_DIVISION;
|
||||
DisplayBpms bpms;
|
||||
pSong->GetDisplayBpms( bpms );
|
||||
int iMaxBPM = (int)bpms.GetMax();
|
||||
iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize) - 1;
|
||||
return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM);
|
||||
if( SHOW_SECTIONS_IN_BPM_SORT )
|
||||
{
|
||||
const int iBPMGroupSize = SORT_BPM_DIVISION;
|
||||
DisplayBpms bpms;
|
||||
pSong->GetDisplayBpms( bpms );
|
||||
int iMaxBPM = (int)bpms.GetMax();
|
||||
iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize) - 1;
|
||||
return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM);
|
||||
}
|
||||
else
|
||||
return RString();
|
||||
}
|
||||
case SORT_LENGTH:
|
||||
{
|
||||
const int iSortLengthSize = SORT_LENGTH_DIVISION;
|
||||
int iMaxLength = (int)pSong->m_fMusicLengthSeconds;
|
||||
iMaxLength += (iSortLengthSize - (iMaxLength%iSortLengthSize) - 1);
|
||||
int iMinLength = iMaxLength - (iSortLengthSize-1);
|
||||
return ssprintf( "%s-%s", SecondsToMMSS(iMinLength).c_str(), SecondsToMMSS(iMaxLength).c_str() );
|
||||
if( SHOW_SECTIONS_IN_LENGTH_SORT )
|
||||
{
|
||||
const int iSortLengthSize = SORT_LENGTH_DIVISION;
|
||||
int iMaxLength = (int)pSong->m_fMusicLengthSeconds;
|
||||
iMaxLength += (iSortLengthSize - (iMaxLength%iSortLengthSize) - 1);
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user