void CPlayCenter::AddSongToList(spSongInfoT songT,unsigned int u_listIndex) { ASSERT(songT); CSongInfo song; song = *songT; return AddSongToList(song,u_listIndex); }
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); }
void CPlayCenter::GetAllPlayList() { RemoveAllList(); if (theRuntimeState->GetLogUserInfo()) { theDbMgr->SetCurrentUser(theRuntimeState->GetLogUserInfo()); } { std::vector<spPlayListInfoT> PlayList; theDbMgr->GetUserDB()->GetAllPlayLists(PlayList); for (auto it=PlayList.begin();it!=PlayList.end();++it) { CPlayListInfo playList; playList.SetComment((*it)->GetComment()); playList.SetFlag((*it)->GetFlag()); playList.SetId((*it)->GetId()); playList.SetListType((*it)->GetListType()); playList.SetLocalId((*it)->GetLocalId()); playList.SetName((*it)->GetName()); playList.SetShow((*it)->IsShow()); playList.SetTag((*it)->GetTag()); AddPlayList(playList); std::vector<spSongInfoT> SongList; theDbMgr->GetUserDB()->GetPlayListSongs(SongList,(*it)->GetLocalId()); for (auto it2=SongList.begin();it2!=SongList.end();++it2) { CSongInfo songInfo; songInfo.SetAblumName((*it2)->GetAlbumName()); songInfo.SetAddTime((*it2)->GetAddTime()); songInfo.SetAlbumId((*it2)->GetAlbumId()); songInfo.SetArtistId((*it2)->GetArtistId()); songInfo.SetArtistName((*it2)->GetArtistName()); songInfo.SetAudioLength((*it2)->GetAudioLength()); songInfo.SetCoverLocalPath((*it2)->GetCoverLocalPath()); songInfo.SetCoverUrl((*it2)->GetCoverUrl()); songInfo.SetEnable((*it2)->IsEnable()); songInfo.SetFileExt((*it2)->GetFileExt()); songInfo.SetFileSize((*it2)->GetFileSize()); songInfo.SetFileStartPos((*it2)->GetFileStartPos()); songInfo.SetFileType((*it2)->GetFileType()); songInfo.SetFlag((*it2)->GetFlag()); songInfo.SetLastModifyTime((*it2)->GetLastModifyTime()); songInfo.SetLastPlayTime((*it2)->GetLastPlayTime()); songInfo.SetListenFileUrl((*it2)->GetListenFileUrl()); songInfo.SetLocal((*it2)->IsLocal()); songInfo.SetLocalId((*it2)->GetLocalId()); songInfo.SetLocalPath((*it2)->GetLocalPath()); songInfo.SetLrcLocalPath((*it2)->GetLrcLocalPath()); songInfo.SetLrcUrl((*it2)->GetLrcUrl()); songInfo.SetMD5((*it2)->GetMD5()); songInfo.SetPlayCount((*it2)->GetPlayCount()); songInfo.SetRealArtistName((*it2)->GetRealArtistName()); songInfo.SetResourceID((*it2)->GetResourceId()); songInfo.SetSongId((*it2)->GetSongId()); songInfo.SetSongName((*it2)->GetSongName()); songInfo.SetTag((*it2)->GetTag()); AddSongToList(songInfo,(*it)->GetLocalId()); } } } }