2009-11-19, 16:44
I did some research in the web api and found that there are no direct function to get the song titles of current playlist,the function GetPlayListContents() only returns filenames,but for a cue+(one big flac) album,it returns the same filenames,you can't get song title from file name.
I took a look into the /xbmc/lib/libGoAhead/XBMChttp.cpp file and located the xbmcGetPlayListContents() function,looks like it should look for the tag information first,if no tag presents it returns the file name,but some how it is not working properlly.
Hope some one will dig deepper into it.if this function works right,it will surelly benifit the remote control programs development.
for your quick reference,I paste the function here,it is not very long.
I took a look into the /xbmc/lib/libGoAhead/XBMChttp.cpp file and located the xbmcGetPlayListContents() function,looks like it should look for the tag information first,if no tag presents it returns the file name,but some how it is not working properlly.
Hope some one will dig deepper into it.if this function works right,it will surelly benifit the remote control programs development.
for your quick reference,I paste the function here,it is not very long.
Code:
1707 int CXbmcHttp::xbmcGetPlayListContents(int numParas, CStdString paras[])
1708 {
1709 CStdString list="";
1710 int playList;
1711
1712 if (numParas<1)
1713 playList=g_playlistPlayer.GetCurrentPlaylist();
1714 else
1715 playList=atoi(paras[0]);
1716 CPlayList& thePlayList = g_playlistPlayer.GetPlaylist(playList);
1717 if (thePlayList.size()==0)
1718 list=openTag+"[Empty]" ;
1719 else
1720 if (g_application.IsPlayingAudio())
1721 {
1722 for (int i=0; i< thePlayList.size(); i++) {
1723 const CPlayListItem& item=thePlayList[i];
1724 const CMusicInfoTag* tagVal=item.GetMusicTag();
1725 if (tagVal && tagVal->GetURL()!="")
1726 list += closeTag+openTag + tagVal->GetURL();
1727 else
1728 list += closeTag+openTag + item.GetFileName();
1729 }
1730 }
1731 else
1732 for (int i=0; i< thePlayList.size(); i++) {
1733 const CPlayListItem& item=thePlayList[i];
1734 list += closeTag+openTag + item.GetFileName();
1735 }
1736 return SetResponse(list) ;
1737 }