本文整理汇总了C++中IWMPMedia::get_attributeCount方法的典型用法代码示例。如果您正苦于以下问题:C++ IWMPMedia::get_attributeCount方法的具体用法?C++ IWMPMedia::get_attributeCount怎么用?C++ IWMPMedia::get_attributeCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWMPMedia
的用法示例。
在下文中一共展示了IWMPMedia::get_attributeCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCurrentSong
BOOL CWmp_scrobbler::GetCurrentSong(SONG_INFO* pSong)
{
USES_CONVERSION;
IWMPMedia* pMedia = NULL;
BSTR bstrValue;
//BSTR bstrName;
BOOL bRet = FALSE;
long lCount = 0;
if( (m_spCore) &&
(pSong != NULL))
{
m_spCore->get_currentMedia(&pMedia);
if(pMedia != NULL)
{
pMedia->get_attributeCount(&lCount);
/*
for(long i = 0; i <= lCount; i++)
{
pMedia->getAttributeName(i, &bstrName);
pMedia->getItemInfo(bstrName, &bstrValue);
PRINTF(DEBUG_INFO, "WMPMEDIA", "Attribute %s - value %s", W2A(bstrName), W2A(bstrValue));
}
// Better check for local/streaming for the future
pMedia->getItemInfo(L"type", &bstrValue);
*/
pMedia->getItemInfo(L"Author", &bstrValue);
EncodingUtils::UnicodeToUtf8(bstrValue, -1, pSong->m_strArtist, SONG_INFO_FIELD_SIZE);
pMedia->getItemInfo(L"Title", &bstrValue);
EncodingUtils::UnicodeToUtf8(bstrValue, -1, pSong->m_strTrack, SONG_INFO_FIELD_SIZE);
pMedia->getItemInfo(L"Album", &bstrValue);
EncodingUtils::UnicodeToUtf8(bstrValue, -1, pSong->m_strAlbum, SONG_INFO_FIELD_SIZE);
pMedia->getItemInfo(L"Genre", &bstrValue);
EncodingUtils::UnicodeToUtf8(bstrValue, -1, pSong->m_strGenre, SONG_INFO_FIELD_SIZE);
pMedia->getItemInfo(L"Comment", &bstrValue);
EncodingUtils::UnicodeToUtf8(bstrValue, -1, pSong->m_strComment, SONG_INFO_FIELD_SIZE);
pMedia->getItemInfo(L"SourceURL", &bstrValue);
EncodingUtils::UnicodeToUtf8(bstrValue, -1, pSong->m_strFileName, SONG_INFO_FIELD_SIZE);
pMedia->getItemInfo(L"Duration", &bstrValue);
pSong->m_nLength = atoi(W2A(bstrValue));
pMedia->getItemInfo(L"Track", &bstrValue);
pSong->m_nTrackNo = atoi(W2A(bstrValue));
pMedia->getItemInfo(L"Year", &bstrValue);
pSong->m_nYear = atoi(W2A(bstrValue));
bRet = TRUE;
}
}
return bRet;
}