Zhiquan
Guest
|
Posted:
Thu Sep 16, 2004 8:01 pm Post subject:
How to parse a playlist file using WMPSDK |
|
|
I need get all media files' path in a playlist file, such as
c:\PlaylistName.m3u (or PlaylistName.wpl, playlistName.asx etc.), how to do
it? Thanks in advance!
========================================================
std::vector<std::string> sMediaFiles;
CComPtr<IWMPPlaylist> spPlaylist;
string strPlaylist = _T("c:\\PlaylistName.m3u ");
// How to get the sPlaylist object from strPlaylist
??? ??? ???
long lCount = 0;
spPlaylist->get_count(&lCount);
for (int i = 0; i < lCount; i++)
{
CComPtr<IWMPMedia> spWMMedia;
spPlaylist->get_item(i, &spWMMedia);
BSTR bsPath;
spWMMedia->get_sourceURL(bsPath);
string sPath = W2A(bsPath);
sMediaFiles.push_back(sPath);
sysFreeString(bsPath);
}
========================================================
|
|