WindowsMediaPlayer控件中的CWMPMedia类如何获取音乐的唱片集,艺术家,流派,演唱者这些信息
WindowsMediaPlayer控件中的CWMPMedia类怎么获取音乐的唱片集,艺术家,流派,演唱者这些信息
MFC应用程序中使用了WindowsMediaPlayer控件,怎么获取音乐的唱片集,艺术家,流派,演唱者信息啊?????
求助!!!!!!!!!!1
------解决方案--------------------
MFC应用程序中使用了WindowsMediaPlayer控件,怎么获取音乐的唱片集,艺术家,流派,演唱者信息啊?????
求助!!!!!!!!!!1
------解决方案--------------------
- C/C++ code
CString name = _T("e:/s.mp3"); m_player.put_URL(name); m_media = static_cast<CWMPMedia>(m_player.newMedia(name)); CString str = m_media.getItemInfo(_T("Artist")); AfxMessageBox(str);
------解决方案--------------------
完整的截图
- C/C++ code
CString name = _T("e:/s.mp3"); m_player.put_URL(name); m_media = static_cast<CWMPMedia>(m_player.newMedia(name)); CString strMsg = _T(""); long lCount = m_media.get_attributeCount(); for (long i = 0; i < lCount; i++) { strMsg.AppendFormat(_T("%s:%s\r\n"), m_media.getAttributeName(i), m_media.getItemInfo(m_media.getAttributeName(i))); } AfxMessageBox(strMsg);
------解决方案--------------------
//COcx1 m_player;
//CWMPMedia m_media;
------解决方案--------------------
- C/C++ code
void CDlg::OnBnClickedButton1() { //COcx1 m_player; //CWMPMedia3 m_media; CString name = _T("e:/你不知道的事2.mp3"); m_player.put_URL(name); m_media = static_cast<CWMPMedia3>(m_player.newMedia(name)); CString strMsg = _T(""); long lCount = m_media.get_attributeCount(); for (long i = 0; i < lCount; i++) { strMsg.AppendFormat(_T("%s:%s\r\n"), m_media.getAttributeName(i), m_media.getItemInfo(m_media.getAttributeName(i))); } //AfxMessageBox(strMsg); strMsg = _T(""); LPINTERNET_CACHE_ENTRY_INFO lpCacheEntryInfo; DWORD dwCacheEntryInfoBufferSize = 0; long lPictureCount = m_media.getAttributeCountByType(_T("WM/Picture"), _T("")); for (long i = 0; i < lPictureCount; i++) { VARIANT var = m_media.getItemInfoByType(_T("WM/Picture"), _T(""), i); if (var.vt == VT_DISPATCH) { CWMPMetadataPicture pic(var.pdispVal); strMsg.AppendFormat(_T("get_Description:%s\r\n"), pic.get_Description()); strMsg.AppendFormat(_T("get_mimeType:%s\r\n"), pic.get_mimeType()); strMsg.AppendFormat(_T("get_pictureType:%s\r\n"), pic.get_pictureType()); strMsg.AppendFormat(_T("get_URL:%s\r\n"), pic.get_URL()); GetUrlCacheEntryInfo(pic.get_URL(), NULL, &dwCacheEntryInfoBufferSize); lpCacheEntryInfo = (LPINTERNET_CACHE_ENTRY_INFO) new byte[dwCacheEntryInfoBufferSize]; if (GetUrlCacheEntryInfo(pic.get_URL(), lpCacheEntryInfo, &dwCacheEntryInfoBufferSize)) { //图片在IE临时文件目录下 strMsg.AppendFormat(_T("实际RUL:%s\r\n"), lpCacheEntryInfo->lpszLocalFileName); } delete lpCacheEntryInfo; } } AfxMessageBox(strMsg); }