17 #include "libmythbase/mythversion.h"
34 qRegisterMetaType<V2MusicMetadataInfoList*>(
"V2MusicMetadataInfoList");
35 qRegisterMetaType<V2MusicMetadataInfo*>(
"V2MusicMetadataInfo");
48 while (!all_music->doneLoading())
50 qApp->processEvents();
62 int musicListCount = musicList->count();
63 nStartIndex = (nStartIndex > 0) ? std::min( nStartIndex, musicListCount ) : 0;
64 nCount = (nCount > 0) ? std::min( nCount, musicListCount ) : musicListCount;
65 int nEndIndex = std::min((nStartIndex + nCount), musicListCount );
67 for(
int n = nStartIndex; n < nEndIndex; n++ )
82 totalPages = (int)std::ceil((
float)musicList->count() / nCount);
88 curPage = (int)std::ceil((
float)nStartIndex / nCount) + 1;
91 pMusicMetadataInfos->setStartIndex ( nStartIndex );
92 pMusicMetadataInfos->setCount ( nCount );
93 pMusicMetadataInfos->setCurrentPage ( curPage );
94 pMusicMetadataInfos->setTotalPages ( totalPages );
95 pMusicMetadataInfos->setTotalAvailable( musicList->count() );
97 pMusicMetadataInfos->setVersion ( MYTH_BINARY_VERSION );
98 pMusicMetadataInfos->setProtoVer ( MYTH_PROTO_VERSION );
102 return pMusicMetadataInfos;
113 while (!all_music->doneLoading())
115 qApp->processEvents();
124 throw(QString(
"No metadata found for selected ID!."));
133 return pMusicMetadataInfo;