本文整理汇总了C++中ProgramInfo::GetCardID方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramInfo::GetCardID方法的具体用法?C++ ProgramInfo::GetCardID怎么用?C++ ProgramInfo::GetCardID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramInfo
的用法示例。
在下文中一共展示了ProgramInfo::GetCardID方法的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: LoadList
void ViewScheduled::LoadList(bool useExistingData)
{
if (m_inFill)
return;
m_inFill = true;
MythUIButtonListItem *currentItem = m_schedulesList->GetItemCurrent();
QString callsign;
QDateTime startts, recstartts;
if (currentItem)
{
ProgramInfo *currentpginfo = qVariantValue<ProgramInfo*>
(currentItem->GetData());
if (currentpginfo)
{
callsign = currentpginfo->GetChannelSchedulingID();
startts = currentpginfo->GetScheduledStartTime();
recstartts = currentpginfo->GetRecordingStartTime();
}
}
QDateTime now = QDateTime::currentDateTime();
QMap<int, int> toomanycounts;
m_schedulesList->Reset();
if (m_groupList)
m_groupList->Reset();
m_recgroupList.clear();
if (!useExistingData)
LoadFromScheduler(m_recList, m_conflictBool);
ProgramList::iterator pit = m_recList.begin();
QString currentDate;
m_recgroupList[m_defaultGroup] = ProgramList(false);
m_recgroupList[m_defaultGroup].setAutoDelete(false);
while (pit != m_recList.end())
{
ProgramInfo *pginfo = *pit;
const RecStatusType recstatus = pginfo->GetRecordingStatus();
if ((pginfo->GetRecordingEndTime() >= now ||
pginfo->GetScheduledEndTime() >= now) &&
(m_showAll ||
recstatus <= rsWillRecord ||
recstatus == rsDontRecord ||
(recstatus == rsTooManyRecordings &&
++toomanycounts[pginfo->GetRecordingRuleID()] <= 1) ||
(recstatus > rsTooManyRecordings &&
recstatus != rsRepeat &&
recstatus != rsNeverRecord)))
{
m_cardref[pginfo->GetCardID()]++;
if (pginfo->GetCardID() > m_maxcard)
m_maxcard = pginfo->GetCardID();
m_inputref[pginfo->GetInputID()]++;
if (pginfo->GetInputID() > m_maxinput)
m_maxinput = pginfo->GetInputID();
QDate date = (pginfo->GetRecordingStartTime()).date();
m_recgroupList[date].push_back(pginfo);
m_recgroupList[date].setAutoDelete(false);
m_recgroupList[m_defaultGroup].push_back(pginfo);
++pit;
}
else
{
pit = m_recList.erase(pit);
continue;
}
}
if (m_groupList)
{
QString label;
QMap<QDate,ProgramList>::iterator dateit = m_recgroupList.begin();
while (dateit != m_recgroupList.end())
{
if (dateit.key().isNull())
label = tr("All");
else
label = dateit.key().toString(m_dateFormat);
new MythUIButtonListItem(m_groupList, label,
qVariantFromValue(dateit.key()));
++dateit;
}
if (!m_recgroupList.contains(m_currentGroup))
m_groupList->SetValueByData(qVariantFromValue(m_currentGroup));
}
FillList();
//.........这里部分代码省略.........