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


C++ QDateTime::GetEnd方法代码示例

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


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