当前位置: 首页>>代码示例>>C++>>正文


C++ Metadata::getAlbumArtFile方法代码示例

本文整理汇总了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");
    }
}
开发者ID:camdbug,项目名称:mythtv,代码行数:21,代码来源:searchview.cpp

示例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)
//.........这里部分代码省略.........
开发者ID:bfosberry,项目名称:mythtv,代码行数:101,代码来源:streamview.cpp


注:本文中的Metadata::getAlbumArtFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。