Add metrics for BPM and Song Length sorting.
Fixes request 173.
This commit is contained in:
@@ -843,6 +843,9 @@ ShowRoulette=true
|
|||||||
ShowRandom=false
|
ShowRandom=false
|
||||||
ShowPortal=false
|
ShowPortal=false
|
||||||
#
|
#
|
||||||
|
SortBPMDivision=20
|
||||||
|
SortLengthDivision=5
|
||||||
|
#
|
||||||
MostPlayedSongsToShow=30
|
MostPlayedSongsToShow=30
|
||||||
RecentSongsToShow=30
|
RecentSongsToShow=30
|
||||||
#
|
#
|
||||||
|
|||||||
+5
-4
@@ -19,6 +19,9 @@
|
|||||||
#include "LuaBinding.h"
|
#include "LuaBinding.h"
|
||||||
#include "EnumHelper.h"
|
#include "EnumHelper.h"
|
||||||
|
|
||||||
|
ThemeMetric<int> SORT_BPM_DIVISION ( "MusicWheel", "SortBPMDivision" );
|
||||||
|
ThemeMetric<int> SORT_LENGTH_DIVISION ( "MusicWheel", "SortLengthDivision" );
|
||||||
|
|
||||||
bool SongCriteria::Matches( const Song *pSong ) const
|
bool SongCriteria::Matches( const Song *pSong ) const
|
||||||
{
|
{
|
||||||
if( !m_sGroupName.empty() && m_sGroupName != pSong->m_sGroupName )
|
if( !m_sGroupName.empty() && m_sGroupName != pSong->m_sGroupName )
|
||||||
@@ -595,8 +598,7 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
|
|||||||
return SORT_NOT_AVAILABLE.GetValue();
|
return SORT_NOT_AVAILABLE.GetValue();
|
||||||
case SORT_BPM:
|
case SORT_BPM:
|
||||||
{
|
{
|
||||||
// todo: make this a theme metric? -aj
|
const int iBPMGroupSize = SORT_BPM_DIVISION;
|
||||||
const int iBPMGroupSize = 20;
|
|
||||||
DisplayBpms bpms;
|
DisplayBpms bpms;
|
||||||
pSong->GetDisplayBpms( bpms );
|
pSong->GetDisplayBpms( bpms );
|
||||||
int iMaxBPM = (int)bpms.GetMax();
|
int iMaxBPM = (int)bpms.GetMax();
|
||||||
@@ -605,8 +607,7 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
|
|||||||
}
|
}
|
||||||
case SORT_LENGTH:
|
case SORT_LENGTH:
|
||||||
{
|
{
|
||||||
// todo: make this a theme metric? -aj
|
const int iSortLengthSize = SORT_LENGTH_DIVISION;
|
||||||
const int iSortLengthSize = 5;
|
|
||||||
int iMaxLength = (int)pSong->m_fMusicLengthSeconds;
|
int iMaxLength = (int)pSong->m_fMusicLengthSeconds;
|
||||||
iMaxLength += (iSortLengthSize - (iMaxLength%iSortLengthSize) - 1);
|
iMaxLength += (iSortLengthSize - (iMaxLength%iSortLengthSize) - 1);
|
||||||
int iMinLength = iMaxLength - (iSortLengthSize-1);
|
int iMinLength = iMaxLength - (iSortLengthSize-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user