Added #TRANSLITERATION tag, and made it preferred over
the full title when sorting. Also noticed that a lot of string copying is done during the ABC sort (and it's call to GetFullTitle)-- optimizing this away may make in-between songs go much faster...
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
------------------------CVS after 3.00 beta 6----------------
|
||||
NEW FEATURE: #TRANSLITERATION tag-- this is used in sorting
|
||||
so songs like sana & matsuri can go in the proper alphabetic group,
|
||||
but still be displayed in their proper language (once we support that)
|
||||
NEW FEATURE: DWI tree loading via "DWIPath".
|
||||
NEW FEATURE: Pump couples support.
|
||||
BUG FIX: Editor no longer crashes if you try to drag a hold note up
|
||||
|
||||
@@ -188,8 +188,9 @@ protected:
|
||||
// if( IsAnInt(sTemp) )
|
||||
// sTemp = "NUM";
|
||||
// return sTemp;
|
||||
case SORT_TITLE:
|
||||
sTemp = pSong->GetFullTitle();
|
||||
case SORT_TITLE:
|
||||
sTemp = pSong->GetTransliteration();
|
||||
if(sTemp.IsEmpty()) sTemp = pSong->GetFullTitle();
|
||||
sTemp.MakeUpper();
|
||||
sTemp = (sTemp.GetLength() > 0) ? sTemp.Left(1) : "";
|
||||
if( IsAnInt(sTemp) )
|
||||
|
||||
@@ -74,6 +74,9 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
|
||||
else if( 0==stricmp(sValueName,"SUBTITLE") )
|
||||
out.m_sSubTitle = sParams[1];
|
||||
|
||||
else if( 0==stricmp(sValueName,"TRANSLITERATION") )
|
||||
out.m_sTransliteration = sParams[1];
|
||||
|
||||
else if( 0==stricmp(sValueName,"ARTIST") )
|
||||
out.m_sArtist = sParams[1];
|
||||
|
||||
|
||||
@@ -627,6 +627,7 @@ void Song::SaveToSMFile( CString sPath, bool bSavingCache )
|
||||
|
||||
fprintf( fp, "#TITLE:%s;\n", m_sMainTitle );
|
||||
fprintf( fp, "#SUBTITLE:%s;\n", m_sSubTitle );
|
||||
fprintf( fp, "#TRANSLITERATION:%s;\n", m_sTransliteration );
|
||||
fprintf( fp, "#ARTIST:%s;\n", m_sArtist );
|
||||
fprintf( fp, "#CREDIT:%s;\n", m_sCredit );
|
||||
fprintf( fp, "#BANNER:%s;\n", m_sBannerFile );
|
||||
@@ -797,7 +798,13 @@ int CompareSongPointersByTitle(const void *arg1, const void *arg2)
|
||||
const Song* pSong1 = *(const Song**)arg1;
|
||||
const Song* pSong2 = *(const Song**)arg2;
|
||||
|
||||
int ret = pSong1->GetFullTitle().CompareNoCase(pSong2->GetFullTitle());
|
||||
//Prefer transliterations to full titles
|
||||
CString sTitle1 = pSong1->GetTransliteration();
|
||||
CString sTitle2 = pSong2->GetTransliteration();
|
||||
if(sTitle1.IsEmpty()) sTitle1 = pSong1->GetFullTitle();
|
||||
if(sTitle2.IsEmpty()) sTitle2 = pSong2->GetFullTitle();
|
||||
|
||||
int ret = sTitle1.CompareNoCase(sTitle2);
|
||||
if(ret != 0) return ret;
|
||||
|
||||
/* The titles are the same. Ensure we get a consistent ordering
|
||||
|
||||
@@ -89,10 +89,12 @@ public:
|
||||
|
||||
CString m_sMainTitle;
|
||||
CString m_sSubTitle;
|
||||
CString m_sTransliteration;
|
||||
CString m_sArtist;
|
||||
CString m_sCredit;
|
||||
|
||||
CString GetFullTitle() const { return m_sMainTitle + (m_sSubTitle.GetLength()? (" " + m_sSubTitle):""); }
|
||||
CString GetTransliteration() const { return m_sTransliteration; }
|
||||
|
||||
CString m_sMusicFile;
|
||||
DWORD m_iMusicBytes;
|
||||
|
||||
Reference in New Issue
Block a user