Пример #1
0
void PlayListMgr::UpdateSong(spSongInfoT spSong,unsigned int u_listId)
{
	ASSERT(spSong);
	playListSongMapIterT itEnd = m_spSongListMap.end();
	for (auto it=m_spSongListMap.begin();it!=itEnd;++it)
	{
		if (it->first == u_listId)
		{
			songsArrayT& songList = it->second;
			int index = 0;
			for (auto it2=songList.begin();it2!=songList.end();++it2)
			{
				if (it2->GetLocalId()==spSong->GetLocalId())
				{
					CSongInfo& songInfo = *it2;
					songInfo.SetAblumName(spSong->GetAlbumName());
					songInfo.SetAddTime(spSong->GetAddTime());
					songInfo.SetAlbumId(spSong->GetAlbumId());
					songInfo.SetArtistId(spSong->GetArtistId());
					songInfo.SetArtistName(spSong->GetArtistName());
					songInfo.SetAudioLength(spSong->GetAudioLength());
					songInfo.SetCoverLocalPath(spSong->GetCoverLocalPath());
					songInfo.SetCoverUrl(spSong->GetCoverUrl());
					songInfo.SetEnable(spSong->IsEnable());
					songInfo.SetFileExt(spSong->GetFileExt());
					songInfo.SetFileSize(spSong->GetFileSize());
					songInfo.SetFileStartPos(spSong->GetFileStartPos());
					songInfo.SetFileType(spSong->GetFileType());
					songInfo.SetFlag(spSong->GetFlag());
					songInfo.SetLastModifyTime(spSong->GetLastModifyTime());
					songInfo.SetLastPlayTime(spSong->GetLastPlayTime());
					songInfo.SetListenFileUrl(spSong->GetListenFileUrl());
					songInfo.SetLocal(spSong->IsLocal());
					songInfo.SetLocalId(spSong->GetLocalId());
					songInfo.SetLocalPath(spSong->GetLocalPath());
					songInfo.SetLrcLocalPath(spSong->GetLrcLocalPath());
					songInfo.SetLrcUrl(spSong->GetLrcUrl());
					songInfo.SetMD5(spSong->GetMD5());
					songInfo.SetPlayCount(spSong->GetPlayCount());
					songInfo.SetRealArtistName(spSong->GetRealArtistName());
					songInfo.SetResourceID(spSong->GetResourceId());
					songInfo.SetSongId(spSong->GetSongId());
					songInfo.SetSongName(spSong->GetSongName());
					songInfo.SetTag(spSong->GetTag());

					break;
				}
			}
		}
	}
}
Пример #2
0
void CPlayCenter::UpdateCurrentPlayingSong(spSongInfoT spSong)
{
	ASSERT(spSong);
	if(m_spPlayList.size()==0||m_spSongListMap.size()==0) return ;
	
	if(m_spPlayList.find(m_iCurPlayingListIndex)==m_spPlayList.end()) return ;
	auto iter = m_spSongListMap.find(m_iCurPlayingListIndex);
	if (iter != m_spSongListMap.end())
	{
		songsArrayT& songs = iter->second;
		if(songs.size()>0)
		{
			int iIndex = 0;
			for (songsArrayIterT iter=songs.begin();iter!=songs.end();++iter)
			{
				if(iter->GetLocalId()==m_iCurPlayingSongIndex)
				{
					songs[iIndex].SetAblumName(spSong->GetAlbumName());
					songs[iIndex].SetAlbumId(spSong->GetAlbumId());
					songs[iIndex].SetAddTime(spSong->GetAddTime());
					songs[iIndex].SetArtistId(spSong->GetArtistId());
					songs[iIndex].SetArtistName(spSong->GetArtistName());
					songs[iIndex].SetAudioLength(spSong->GetAudioLength());
					songs[iIndex].SetCoverLocalPath(spSong->GetCoverLocalPath());
					songs[iIndex].SetCoverUrl(spSong->GetCoverUrl());
					songs[iIndex].SetEnable(spSong->IsEnable());
					songs[iIndex].SetFileExt(spSong->GetFileExt());
					songs[iIndex].SetFileSize(spSong->GetFileSize());
					songs[iIndex].SetFileStartPos(spSong->GetFileStartPos());
					songs[iIndex].SetFileType(spSong->GetFileType());
					songs[iIndex].SetFlag(spSong->GetFlag());
					songs[iIndex].SetLastModifyTime(spSong->GetLastModifyTime());
					songs[iIndex].SetLastPlayTime(spSong->GetLastPlayTime());
					songs[iIndex].SetListenFileUrl(spSong->GetListenFileUrl());
					songs[iIndex].SetLocal(spSong->IsLocal());
					songs[iIndex].SetLocalId(spSong->GetLocalId());
					songs[iIndex].SetLocalPath(spSong->GetLocalPath());
					songs[iIndex].SetLrcLocalPath(spSong->GetLrcLocalPath());
					songs[iIndex].SetLrcUrl(spSong->GetLrcUrl());
					songs[iIndex].SetMD5(spSong->GetMD5());
					songs[iIndex].SetPlayCount(spSong->GetPlayCount());
					songs[iIndex].SetRealArtistName(spSong->GetRealArtistName());
					songs[iIndex].SetResourceID(spSong->GetResourceId());
					songs[iIndex].SetSongId(spSong->GetSongId());
					songs[iIndex].SetSongName(spSong->GetSongName());
					songs[iIndex].SetTag(spSong->GetTag());
					break;
				}
				iIndex ++;
			}
		}
	}
}
Пример #3
0
void PlayListMgr::RemoveSongFromList(spSongInfoT spSong,unsigned int u_listId)
{
	ASSERT(spSong);
	playListSongMapIterT it = m_spSongListMap.find(u_listId);
	if (it!=m_spSongListMap.end())
	{
		songsArrayT& songArr = it->second;
		songsArrayIterT itSong = songArr.begin();
		for (;itSong!=songArr.end();++itSong)
		{
			if (itSong->GetLocalId()==spSong->GetLocalId())
			{
				songArr.erase(itSong);
				break;
			}
		}
	}
}
Пример #4
0
void PlayListMgr::AddSongToList(spSongInfoT spSong,unsigned int u_listId)
{
	ASSERT(spSong);
	CSongInfo songInfo;
	songInfo.SetAblumName(spSong->GetAlbumName());
	songInfo.SetAddTime(spSong->GetAddTime());
	songInfo.SetAlbumId(spSong->GetAlbumId());
	songInfo.SetArtistId(spSong->GetArtistId());
	songInfo.SetArtistName(spSong->GetArtistName());
	songInfo.SetAudioLength(spSong->GetAudioLength());
	songInfo.SetCoverLocalPath(spSong->GetCoverLocalPath());
	songInfo.SetCoverUrl(spSong->GetCoverUrl());
	songInfo.SetEnable(spSong->IsEnable());
	songInfo.SetFileExt(spSong->GetFileExt());
	songInfo.SetFileSize(spSong->GetFileSize());
	songInfo.SetFileStartPos(spSong->GetFileStartPos());
	songInfo.SetFileType(spSong->GetFileType());
	songInfo.SetFlag(spSong->GetFlag());
	songInfo.SetLastModifyTime(spSong->GetLastModifyTime());
	songInfo.SetLastPlayTime(spSong->GetLastPlayTime());
	songInfo.SetListenFileUrl(spSong->GetListenFileUrl());
	songInfo.SetLocal(spSong->IsLocal());
	songInfo.SetLocalId(spSong->GetLocalId());
	songInfo.SetLocalPath(spSong->GetLocalPath());
	songInfo.SetLrcLocalPath(spSong->GetLrcLocalPath());
	songInfo.SetLrcUrl(spSong->GetLrcUrl());
	songInfo.SetMD5(spSong->GetMD5());
	songInfo.SetPlayCount(spSong->GetPlayCount());
	songInfo.SetRealArtistName(spSong->GetRealArtistName());
	songInfo.SetResourceID(spSong->GetResourceId());
	songInfo.SetSongId(spSong->GetSongId());
	songInfo.SetSongName(spSong->GetSongName());
	songInfo.SetTag(spSong->GetTag());

	AddSongToList(songInfo,u_listId);
}