本文整理汇总了C++中Metadata::getAlbumArtFile方法的典型用法代码示例。如果您正苦于以下问题:C++ Metadata::getAlbumArtFile方法的具体用法?C++ Metadata::getAlbumArtFile怎么用?C++ Metadata::getAlbumArtFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Metadata
的用法示例。
在下文中一共展示了Metadata::getAlbumArtFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trackVisible
void SearchView::trackVisible(MythUIButtonListItem *item)
{
if (!item)
return;
if (item->GetImage().isEmpty())
{
Metadata *mdata = qVariantValue<Metadata*> (item->GetData());
if (mdata)
{
QString artFile = mdata->getAlbumArtFile();
if (artFile.isEmpty())
item->SetImage("mm_nothumb.png");
else
item->SetImage(mdata->getAlbumArtFile());
}
else
item->SetImage("mm_nothumb.png");
}
}
示例2: customEvent
void StreamView::customEvent(QEvent *event)
{
bool handled = true;
if (event->type() == MusicPlayerEvent::PlayedTracksChangedEvent)
{
if (gPlayer->getPlayedTracksList().count())
updateTrackInfo(gPlayer->getCurrentMetadata());
// add the new track to the list
if (m_playedTracksList && gPlayer->getPlayedTracksList().count())
{
Metadata *mdata = gPlayer->getPlayedTracksList().last();
MythUIButtonListItem *item =
new MythUIButtonListItem(m_playedTracksList, "", qVariantFromValue(mdata), 0);
MetadataMap metadataMap;
mdata->toMap(metadataMap);
item->SetTextFromMap(metadataMap);
item->SetFontState("normal");
item->DisplayState("default", "playstate");
item->SetImage(mdata->getAlbumArtFile());
m_playedTracksList->SetItemCurrent(item);
}
}
else if (event->type() == MusicPlayerEvent::TrackChangeEvent)
{
MusicPlayerEvent *mpe = dynamic_cast<MusicPlayerEvent *>(event);
if (!mpe)
return;
int trackNo = mpe->TrackID;
if (m_streamList)
{
if (m_currentTrack >= 0 && m_currentTrack < m_streamList->GetCount())
{
MythUIButtonListItem *item = m_streamList->GetItemAt(m_currentTrack);
if (item)
{
item->SetFontState("normal");
item->DisplayState("default", "playstate");
}
}
if (trackNo >= 0 && trackNo < m_streamList->GetCount())
{
if (m_currentTrack == m_streamList->GetCurrentPos())
m_streamList->SetItemCurrent(trackNo);
MythUIButtonListItem *item = m_streamList->GetItemAt(trackNo);
if (item)
{
item->SetFontState("running");
item->DisplayState("playing", "playstate");
}
}
}
m_currentTrack = trackNo;
updateTrackInfo(gPlayer->getCurrentMetadata());
}
else if (event->type() == OutputEvent::Playing)
{
if (gPlayer->isPlaying())
{
if (m_streamList)
{
MythUIButtonListItem *item = m_streamList->GetItemAt(m_currentTrack);
if (item)
{
item->SetFontState("running");
item->DisplayState("playing", "playstate");
}
}
}
// pass it on to the default handler in MusicCommon
handled = false;
}
else if (event->type() == OutputEvent::Stopped)
{
if (m_streamList)
{
MythUIButtonListItem *item = m_streamList->GetItemAt(m_currentTrack);
if (item)
{
item->SetFontState("normal");
item->DisplayState("stopped", "playstate");
}
}
// pass it on to the default handler in MusicCommon
handled = false;
}
else if (event->type() == OutputEvent::Buffering)
//.........这里部分代码省略.........