本文整理汇总了C++中MythUIButtonListItem::SetFontState方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIButtonListItem::SetFontState方法的具体用法?C++ MythUIButtonListItem::SetFontState怎么用?C++ MythUIButtonListItem::SetFontState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIButtonListItem
的用法示例。
在下文中一共展示了MythUIButtonListItem::SetFontState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateStreamList
void StreamView::updateStreamList(void)
{
m_streamList->Reset();
bool foundActiveStream = false;
for (int x = 0; x < gPlayer->getPlaylist()->getSongs().count(); x++)
{
Metadata *mdata = gPlayer->getPlaylist()->getSongs().at(x);
MythUIButtonListItem *item = new MythUIButtonListItem(m_streamList, "", qVariantFromValue(mdata));
MetadataMap metadataMap;
if (mdata)
mdata->toMap(metadataMap);
item->SetTextFromMap(metadataMap);
item->SetText("", "imageloaded");
item->SetFontState("normal");
item->DisplayState("default", "playstate");
// if this is the current radio stream update its play state to match the player
if (gPlayer->getCurrentMetadata() && mdata->ID() == gPlayer->getCurrentMetadata()->ID())
{
if (gPlayer->isPlaying())
{
item->SetFontState("running");
item->DisplayState("playing", "playstate");
}
else if (gPlayer->isPaused())
{
item->SetFontState("idle");
item->DisplayState("paused", "playstate");
}
else
{
item->SetFontState("normal");
item->DisplayState("stopped", "playstate");
}
m_streamList->SetItemCurrent(item);
foundActiveStream = true;
}
}
if (m_streamList->GetCount() > 0 && !foundActiveStream)
{
m_streamList->SetItemCurrent(0);
gPlayer->stop(true);
}
if (m_noStreams)
m_noStreams->SetVisible((m_streamList->GetCount() == 0));
if (m_streamList->GetCount() == 0)
LOG(VB_GENERAL, LOG_ERR, "StreamView hasn't found any streams!");
}
示例2: AddLogLine
MythUIButtonListItem* StatusBox::AddLogLine(const QString & line,
const QString & help,
const QString & detail,
const QString & helpdetail,
const QString & state,
const QString & data)
{
LogLine logline;
logline.line = line;
if (detail.isEmpty())
logline.detail = line;
else
logline.detail = detail;
if (help.isEmpty())
logline.help = logline.detail;
else
logline.help = help;
if (helpdetail.isEmpty())
logline.helpdetail = logline.detail;
else
logline.helpdetail = helpdetail;
logline.state = state;
logline.data = data;
MythUIButtonListItem *item = new MythUIButtonListItem(m_logList, line,
qVariantFromValue(logline));
if (logline.state.isEmpty())
logline.state = "normal";
item->SetFontState(logline.state);
item->DisplayState(logline.state, "status");
item->SetText(logline.detail, "detail");
return item;
}
示例3: 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)
//.........这里部分代码省略.........