本文整理汇总了C++中ProgramInfo::SetScheduledEndTime方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramInfo::SetScheduledEndTime方法的具体用法?C++ ProgramInfo::SetScheduledEndTime怎么用?C++ ProgramInfo::SetScheduledEndTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramInfo
的用法示例。
在下文中一共展示了ProgramInfo::SetScheduledEndTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: query
/** \brief Fills RecordingInfo for the program that airs at
* "desiredts" on "chanid".
* \param chanid %Channel ID on which to search for program.
* \param desiredts Date and Time for which we desire the program.
* \param genUnknown Generate a full entry for live-tv if unknown
* \param maxHours Clamp the maximum time to X hours from dtime.
* \return LoadStatus describing what happened.
*/
RecordingInfo::RecordingInfo(
uint _chanid, const QDateTime &desiredts,
bool genUnknown, uint maxHours, LoadStatus *status) :
oldrecstatus(rsUnknown),
savedrecstatus(rsUnknown),
future(false),
schedorder(0),
mplexid(0),
desiredrecstartts(),
desiredrecendts(),
record(NULL)
{
ProgramList schedList;
ProgramList progList;
MSqlBindings bindings;
QString querystr = "WHERE program.chanid = :CHANID AND "
" program.starttime < :STARTTS1 AND "
" program.endtime > :STARTTS2 ";
bindings[":CHANID"] = QString::number(_chanid);
QDateTime query_startts = desiredts.addSecs(50 - desiredts.time().second());
bindings[":STARTTS1"] = query_startts;
bindings[":STARTTS2"] = query_startts;
::LoadFromScheduler(schedList);
LoadFromProgram(progList, querystr, bindings, schedList);
if (!progList.empty())
{
ProgramInfo *pginfo = progList[0];
if (maxHours > 0)
{
if (desiredts.secsTo(
pginfo->GetScheduledEndTime()) > (int)maxHours * 3600)
{
pginfo->SetScheduledEndTime(desiredts.addSecs(maxHours * 3600));
pginfo->SetRecordingEndTime(pginfo->GetScheduledEndTime());
}
}
*this = *pginfo;
if (status)
*status = kFoundProgram;
return;
}
recstartts = startts = desiredts;
recendts = endts = desiredts;
lastmodified = desiredts;
MSqlQuery query(MSqlQuery::InitCon());
query.prepare("SELECT chanid, channum, callsign, name, "
"commmethod, outputfilters "
"FROM channel "
"WHERE chanid = :CHANID");
query.bindValue(":CHANID", _chanid);
if (!query.exec())
{
MythDB::DBError("Loading Program overlapping a datetime", query);
if (status)
*status = kNoProgram;
return;
}
if (!query.next())
{
if (status)
*status = kNoProgram;
return;
}
chanid = query.value(0).toUInt();
chanstr = query.value(1).toString();
chansign = query.value(2).toString();
channame = query.value(3).toString();
programflags &= ~FL_CHANCOMMFREE;
programflags |= (query.value(4).toInt() == COMM_DETECT_COMMFREE) ?
FL_CHANCOMMFREE : 0;
chanplaybackfilters = query.value(5).toString();
{
QMutexLocker locker(&staticDataLock);
if (unknownTitle.isEmpty())
unknownTitle = gCoreContext->GetSetting("UnknownTitle");
title = unknownTitle;
title.detach();
}
if (!genUnknown)
{
//.........这里部分代码省略.........