本文整理汇总了C++中ProgramInfo::GetRecordingPriority2方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramInfo::GetRecordingPriority2方法的具体用法?C++ ProgramInfo::GetRecordingPriority2怎么用?C++ ProgramInfo::GetRecordingPriority2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramInfo
的用法示例。
在下文中一共展示了ProgramInfo::GetRecordingPriority2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillList
void ViewScheduled::FillList()
{
m_schedulesList->Reset();
MythUIText *norecordingText = dynamic_cast<MythUIText*>
(GetChild("norecordings_info"));
if (norecordingText)
norecordingText->SetVisible(m_recList.empty());
if (m_recList.empty())
return;
ProgramList plist;
if (!m_recgroupList.contains(m_currentGroup))
m_currentGroup = m_defaultGroup;
plist = m_recgroupList[m_currentGroup];
ProgramList::iterator pit = plist.begin();
while (pit != plist.end())
{
ProgramInfo *pginfo = *pit;
if (!pginfo)
{
++pit;
continue;
}
QString state;
const RecStatusType recstatus = pginfo->GetRecordingStatus();
if (recstatus == rsRecording)
state = "running";
else if (recstatus == rsConflict ||
recstatus == rsOffLine ||
recstatus == rsTunerBusy ||
recstatus == rsFailed ||
recstatus == rsAborted ||
recstatus == rsMissed)
state = "error";
else if (recstatus == rsWillRecord)
{
if ((m_curcard == 0 && m_curinput == 0) ||
pginfo->GetCardID() == m_curcard ||
pginfo->GetInputID() == m_curinput)
{
if (pginfo->GetRecordingPriority2() < 0)
state = "warning";
else
state = "normal";
}
}
else if (recstatus == rsRepeat ||
recstatus == rsOtherShowing ||
recstatus == rsNeverRecord ||
recstatus == rsDontRecord ||
(recstatus != rsDontRecord &&
recstatus <= rsEarlierShowing))
state = "disabled";
else
state = "warning";
MythUIButtonListItem *item =
new MythUIButtonListItem(m_schedulesList,"",
qVariantFromValue(pginfo));
InfoMap infoMap;
pginfo->ToMap(infoMap);
item->SetTextFromMap(infoMap, state);
QString rating = QString::number(pginfo->GetStars(10));
item->DisplayState(rating, "ratingstate");
item->DisplayState(state, "status");
++pit;
}
MythUIText *statusText = dynamic_cast<MythUIText*>(GetChild("status"));
if (statusText)
{
if (m_conflictBool)
{
// Find first conflict and store in m_conflictDate field
ProgramList::const_iterator it = plist.begin();
for (; it != plist.end(); ++it)
{
ProgramInfo &p = **it;
if (p.GetRecordingStatus() == rsConflict)
{
m_conflictDate = p.GetRecordingStartTime().date();
break;
}
}
// figure out caption based on m_conflictDate
QString cstring = tr("Time Conflict");
QDate now = QDate::currentDate();
int daysToConflict = now.daysTo(m_conflictDate);
//.........这里部分代码省略.........
示例2: FillList
void ViewScheduled::FillList()
{
m_schedulesList->Reset();
MythUIText *norecordingText = dynamic_cast<MythUIText*>
(GetChild("norecordings_info"));
if (norecordingText)
norecordingText->SetVisible(m_recList.empty());
if (m_recList.empty())
return;
ProgramList plist;
if (!m_recgroupList.contains(m_currentGroup))
m_currentGroup = m_defaultGroup;
plist = m_recgroupList[m_currentGroup];
ProgramList::iterator pit = plist.begin();
while (pit != plist.end())
{
ProgramInfo *pginfo = *pit;
if (!pginfo)
{
++pit;
continue;
}
QString state;
const RecStatus::Type recstatus = pginfo->GetRecordingStatus();
if (recstatus == RecStatus::Recording ||
recstatus == RecStatus::Tuning)
state = "running";
else if (recstatus == RecStatus::Conflict ||
recstatus == RecStatus::Offline ||
recstatus == RecStatus::TunerBusy ||
recstatus == RecStatus::Failed ||
recstatus == RecStatus::Failing ||
recstatus == RecStatus::Aborted ||
recstatus == RecStatus::Missed)
state = "error";
else if (recstatus == RecStatus::WillRecord ||
recstatus == RecStatus::Pending)
{
if (m_curinput == 0 || pginfo->GetInputID() == m_curinput)
{
if (pginfo->GetRecordingPriority2() < 0)
state = "warning";
else
state = "normal";
}
}
else if (recstatus == RecStatus::Repeat ||
recstatus == RecStatus::NeverRecord ||
recstatus == RecStatus::DontRecord ||
(recstatus != RecStatus::DontRecord &&
recstatus <= RecStatus::EarlierShowing))
state = "disabled";
else
state = "warning";
MythUIButtonListItem *item =
new MythUIButtonListItem(m_schedulesList,"",
qVariantFromValue(pginfo));
InfoMap infoMap;
pginfo->ToMap(infoMap);
item->SetTextFromMap(infoMap, state);
QString rating = QString::number(pginfo->GetStars(10));
item->DisplayState(rating, "ratingstate");
item->DisplayState(state, "status");
++pit;
}
MythUIText *statusText = dynamic_cast<MythUIText*>(GetChild("status"));
if (statusText)
{
if (m_conflictBool)
{
// Find first conflict and store in m_conflictDate field
ProgramList::const_iterator it = plist.begin();
for (; it != plist.end(); ++it)
{
ProgramInfo &p = **it;
if (p.GetRecordingStatus() == RecStatus::Conflict)
{
m_conflictDate = p.GetRecordingStartTime()
.toLocalTime().date();
break;
}
}
// TODO: This can be templated instead of hardcoding
// Conflict/No Conflict
QString cstring = tr("Conflict %1")
//.........这里部分代码省略.........