int CGenreTable::SearchGenre( CUString strSearch ) const { int i; strSearch.TrimLeft(); strSearch.TrimRight(); for ( i = 0 ; i < (int)v_Entries.size(); i++ ) { if ( 0 == strSearch.CompareNoCase( GetGenre( i ) ) ) { return i; } } return -1; }
int CGenreTable::AddEntry( INT nID3V1ID, const CUString& strGenre, const CUString& strCDDBGenre, bool bCanBeModified ) { bool bAdd = true; int i = 0; GENRETABLEENTRY newEntry; newEntry.nID3V1ID = nID3V1ID; newEntry.strGenre = strGenre; newEntry.bCanBeModified = bCanBeModified; newEntry.strCDDBGenre = strCDDBGenre; newEntry.strGenre.TrimLeft(); newEntry.strGenre.TrimRight(); newEntry.strCDDBGenre.TrimLeft(); newEntry.strCDDBGenre.TrimRight(); // check if entry is already in this list for ( i = 0 ; i < (int)v_Entries.size(); i++ ) { if ( GetID3V1ID( i ) == nID3V1ID && ( 0 == strGenre.CompareNoCase( GetGenre( i ) ) ) ) { bAdd = false; } } if ( true == bAdd ) { v_Entries.push_back( newEntry ); // Sort(); } return v_Entries.size(); }