本文整理汇总了C++中QDateTime::GetEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ QDateTime::GetEnd方法的具体用法?C++ QDateTime::GetEnd怎么用?C++ QDateTime::GetEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDateTime
的用法示例。
在下文中一共展示了QDateTime::GetEnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
RecordingQuality::RecordingQuality(
const RecordingInfo *ri, const RecordingGaps &rg,
const QDateTime &first, const QDateTime &latest) :
m_continuity_error_count(0), m_packet_count(0),
m_overall_score(1.0), m_recording_gaps(rg)
{
if (!ri)
return;
m_program_key = ri->MakeUniqueKey();
// trim start
QDateTime start = get_start(*ri);
while (!m_recording_gaps.empty() &&
m_recording_gaps.first().GetStart() < start)
{
RecordingGap &first = m_recording_gaps.first();
if (start < first.GetEnd())
first = RecordingGap(start, first.GetEnd());
else
m_recording_gaps.pop_front();
}
// trim end
QDateTime end = get_end(*ri);
while (!m_recording_gaps.empty() &&
m_recording_gaps.back().GetEnd() > end)
{
RecordingGap &back = m_recording_gaps.back();
if (back.GetStart() < end)
back = RecordingGap(back.GetStart(), end);
else
m_recording_gaps.pop_back();
}
// account for late start
int start_gap = (first.isValid()) ? start.secsTo(first) : 0;
if (start_gap > 15)
m_recording_gaps.push_front(RecordingGap(start, first));
// account for missing end
int end_gap = (latest.isValid()) ? latest.secsTo(end) : 0;
if (end_gap > 15)
m_recording_gaps.push_back(RecordingGap(latest, end));
stable_sort(m_recording_gaps.begin(), m_recording_gaps.end());
merge_overlapping(m_recording_gaps);
m_overall_score = score_gaps(*ri, m_recording_gaps);
LOG(VB_RECORD, LOG_INFO,
QString("RecordingQuality() start(%1) end(%2) score(%3)")
.arg(MythDate::toString(start, MythDate::ISODate))
.arg(MythDate::toString(end, MythDate::ISODate))
.arg(m_overall_score));
}