Tuniac1/TuniacApp/BasePlaylist.cpp
//will return the next song index for the index given. DOES NOT follow queues

will return the next song index for the index given. DOES NOT follow queues
will return the next song index for the index given . DOES NOT follow queues
unsigned long		CBasePlaylist::GetNextFilteredIndexForFilteredIndex(unsigned long ulFilteredIndex)
{
	if(GetNumItems() == 0)
		return INVALID_PLAYLIST_INDEX;
	if(!CheckFilteredIndex(ulFilteredIndex))
		return 0;
	if(tuniacApp.m_Preferences.GetRepeatMode() == RepeatOne)
		return ulFilteredIndex;
	if(tuniacApp.m_Preferences.GetSkipStreams() && tuniacApp.m_Preferences.GetShuffleState() && GetPlaylistType() == PLAYLIST_TYPE_MEDIALIBRARY)
	{
		for(unsigned long x=(ulFilteredIndex + 1); x<m_NormalIndexArray.GetCount(); x++)
		{
			IPlaylistEntry * pIPE = GetEntryAtFilteredIndex(x);
			if(pIPE)
			{
				if(!PathIsURL((LPTSTR)pIPE->GetField(FIELD_URL)))
					return x;
			}
		}
		if(tuniacApp.m_Preferences.GetRepeatMode() == RepeatAll)
		{
			for(unsigned long x=0; x<m_NormalIndexArray.GetCount(); x++)
			{
				IPlaylistEntry * pIPE = GetEntryAtFilteredIndex(x);
				if(pIPE)
				{
					if(!PathIsURL((LPTSTR)pIPE->GetField(FIELD_URL)))
						return x;
				}
			}
		}
	}
	else
	{
		if(ulFilteredIndex == (m_NormalIndexArray.GetCount() - 1) && tuniacApp.m_Preferences.GetRepeatMode() == RepeatAll)
			return 0;
		if(ulFilteredIndex < m_NormalIndexArray.GetCount() - 1)
			return ulFilteredIndex + 1;
	}
	return 0;
}
unsigned long CBasePlaylist :: GetNextFilteredIndexForFilteredIndex ( unsigned long ulFilteredIndex ) { if ( GetNumItems ( ) == 0 ) return INVALID_PLAYLIST_INDEX ; if ( ! CheckFilteredIndex ( ulFilteredIndex ) ) return 0 ; if ( tuniacApp . m_Preferences . GetRepeatMode ( ) == RepeatOne ) return ulFilteredIndex ; if ( tuniacApp . m_Preferences . GetSkipStreams ( ) && tuniacApp . m_Preferences . GetShuffleState ( ) && GetPlaylistType ( ) == PLAYLIST_TYPE_MEDIALIBRARY ) { for ( unsigned long x = ( ulFilteredIndex + 1 ) ; x < m_NormalIndexArray . GetCount ( ) ; x ++ ) { IPlaylistEntry * pIPE = GetEntryAtFilteredIndex ( x ) ; if ( pIPE ) { if ( ! PathIsURL ( ( LPTSTR ) pIPE -> GetField ( FIELD_URL ) ) ) return x ; } } if ( tuniacApp . m_Preferences . GetRepeatMode ( ) == RepeatAll ) { for ( unsigned long x = 0 ; x < m_NormalIndexArray . GetCount ( ) ; x ++ ) { IPlaylistEntry * pIPE = GetEntryAtFilteredIndex ( x ) ; if ( pIPE ) { if ( ! PathIsURL ( ( LPTSTR ) pIPE -> GetField ( FIELD_URL ) ) ) return x ; } } } } else { if ( ulFilteredIndex == ( m_NormalIndexArray . GetCount ( ) - 1 ) && tuniacApp . m_Preferences . GetRepeatMode ( ) == RepeatAll ) return 0 ; if ( ulFilteredIndex < m_NormalIndexArray . GetCount ( ) - 1 ) return ulFilteredIndex + 1 ; } return 0 ; }
will return the next song index for the index given.
will return the next song index for the index given .
//there is no files, there is no next
 //no valid start, so just start from the beginning again
 //if we didn't find anything and we are repeating start going through the list again
 //we are at the last song
 //m_NormalIndexArray/m_RandomIndexArray should be the same length
 //try to set active as +1 of current active
 //no more files
