本文整理汇总了C++中dtc::ProgramList::setProtoVer方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramList::setProtoVer方法的具体用法?C++ ProgramList::setProtoVer怎么用?C++ ProgramList::setProtoVer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dtc::ProgramList
的用法示例。
在下文中一共展示了ProgramList::setProtoVer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetConflictList
DTC::ProgramList* Dvr::GetConflictList( int nStartIndex,
int nCount,
int nRecordId )
{
RecordingList recordingList; // Auto-delete deque
RecList tmpList; // Standard deque, objects must be deleted
if (nRecordId <= 0)
nRecordId = -1;
// NOTE: Fetching this information directly from the schedule is
// significantly faster than using ProgramInfo::LoadFromScheduler()
Scheduler *scheduler = dynamic_cast<Scheduler*>(gCoreContext->GetScheduler());
if (scheduler)
scheduler->GetAllPending(tmpList, nRecordId);
// Sort the upcoming into only those which are conflicts
RecList::iterator it = tmpList.begin();
for(; it < tmpList.end(); ++it)
{
if (((*it)->GetRecordingStatus() == RecStatus::Conflict) &&
((*it)->GetRecordingStartTime() >= MythDate::current()))
{
recordingList.push_back(new RecordingInfo(**it));
}
delete *it;
*it = NULL;
}
// ----------------------------------------------------------------------
// Build Response
// ----------------------------------------------------------------------
DTC::ProgramList *pPrograms = new DTC::ProgramList();
nStartIndex = min( nStartIndex, (int)recordingList.size() );
nCount = (nCount > 0) ? min( nCount, (int)recordingList.size() ) : recordingList.size();
int nEndIndex = min((nStartIndex + nCount), (int)recordingList.size() );
for( int n = nStartIndex; n < nEndIndex; n++)
{
ProgramInfo *pInfo = recordingList[ n ];
DTC::Program *pProgram = pPrograms->AddNewProgram();
FillProgramInfo( pProgram, pInfo, true );
}
// ----------------------------------------------------------------------
pPrograms->setStartIndex ( nStartIndex );
pPrograms->setCount ( nCount );
pPrograms->setTotalAvailable( recordingList.size() );
pPrograms->setAsOf ( MythDate::current() );
pPrograms->setVersion ( MYTH_BINARY_VERSION );
pPrograms->setProtoVer ( MYTH_PROTO_VERSION );
return pPrograms;
}
示例2: GetConflictList
DTC::ProgramList* Dvr::GetConflictList( int nStartIndex,
int nCount,
int nRecordId )
{
RecordingList recordingList;
RecordingList tmpList;
bool hasConflicts;
if (nRecordId <= 0)
nRecordId = -1;
LoadFromScheduler(tmpList, hasConflicts, "", nRecordId);
// Sort the upcoming into only those which are conflicts
RecordingList::iterator it = tmpList.begin();
for(; it < tmpList.end(); ++it)
{
if (nRecordId > 0 &&
(*it)->GetRecordingRuleID() != static_cast<uint>(nRecordId))
continue;
if (((*it)->GetRecordingStatus() == RecStatus::Conflict) &&
((*it)->GetRecordingStartTime() >= MythDate::current()))
{
recordingList.push_back(new RecordingInfo(**it));
}
}
// ----------------------------------------------------------------------
// Build Response
// ----------------------------------------------------------------------
DTC::ProgramList *pPrograms = new DTC::ProgramList();
nStartIndex = min( nStartIndex, (int)recordingList.size() );
nCount = (nCount > 0) ? min( nCount, (int)recordingList.size() ) : recordingList.size();
int nEndIndex = min((nStartIndex + nCount), (int)recordingList.size() );
for( int n = nStartIndex; n < nEndIndex; n++)
{
ProgramInfo *pInfo = recordingList[ n ];
DTC::Program *pProgram = pPrograms->AddNewProgram();
FillProgramInfo( pProgram, pInfo, true );
}
// ----------------------------------------------------------------------
pPrograms->setStartIndex ( nStartIndex );
pPrograms->setCount ( nCount );
pPrograms->setTotalAvailable( recordingList.size() );
pPrograms->setAsOf ( MythDate::current() );
pPrograms->setVersion ( MYTH_BINARY_VERSION );
pPrograms->setProtoVer ( MYTH_PROTO_VERSION );
return pPrograms;
}
示例3: GetUpcomingList
DTC::ProgramList* Dvr::GetUpcomingList( int nStartIndex,
int nCount,
bool bShowAll )
{
RecordingList recordingList;
RecordingList tmpList;
bool hasConflicts;
LoadFromScheduler(tmpList, hasConflicts);
// Sort the upcoming into only those which will record
RecordingList::iterator it = tmpList.begin();
for(; it < tmpList.end(); ++it)
{
if (!bShowAll && ((*it)->GetRecordingStatus() <= rsWillRecord) &&
((*it)->GetRecordingStartTime() >=
QDateTime::currentDateTime()))
{
recordingList.push_back(new RecordingInfo(**it));
}
else if (bShowAll && ((*it)->GetRecordingStartTime() >=
QDateTime::currentDateTime()))
{
recordingList.push_back(new RecordingInfo(**it));
}
}
// ----------------------------------------------------------------------
// Build Response
// ----------------------------------------------------------------------
DTC::ProgramList *pPrograms = new DTC::ProgramList();
nStartIndex = min( nStartIndex, (int)recordingList.size() );
nCount = (nCount > 0) ? min( nCount, (int)recordingList.size() ) : recordingList.size();
int nEndIndex = min((nStartIndex + nCount), (int)recordingList.size() );
for( int n = nStartIndex; n < nEndIndex; n++)
{
ProgramInfo *pInfo = recordingList[ n ];
DTC::Program *pProgram = pPrograms->AddNewProgram();
FillProgramInfo( pProgram, pInfo, true );
}
// ----------------------------------------------------------------------
pPrograms->setStartIndex ( nStartIndex );
pPrograms->setCount ( nCount );
pPrograms->setTotalAvailable( recordingList.size() );
pPrograms->setAsOf ( QDateTime::currentDateTime() );
pPrograms->setVersion ( MYTH_BINARY_VERSION );
pPrograms->setProtoVer ( MYTH_PROTO_VERSION );
return pPrograms;
}
示例4: GetExpiringList
DTC::ProgramList* Dvr::GetExpiringList( int nStartIndex,
int nCount )
{
pginfolist_t infoList;
if (expirer)
expirer->GetAllExpiring( infoList );
// ----------------------------------------------------------------------
// Build Response
// ----------------------------------------------------------------------
DTC::ProgramList *pPrograms = new DTC::ProgramList();
nStartIndex = min( nStartIndex, (int)infoList.size() );
nCount = (nCount > 0) ? min( nCount, (int)infoList.size() ) : infoList.size();
int nEndIndex = min((nStartIndex + nCount), (int)infoList.size() );
for( int n = nStartIndex; n < nEndIndex; n++)
{
ProgramInfo *pInfo = infoList[ n ];
if (pInfo != NULL)
{
DTC::Program *pProgram = pPrograms->AddNewProgram();
FillProgramInfo( pProgram, pInfo, true );
delete pInfo;
}
}
// ----------------------------------------------------------------------
pPrograms->setStartIndex ( nStartIndex );
pPrograms->setCount ( nCount );
pPrograms->setTotalAvailable( infoList.size() );
pPrograms->setAsOf ( MythDate::current() );
pPrograms->setVersion ( MYTH_BINARY_VERSION );
pPrograms->setProtoVer ( MYTH_PROTO_VERSION );
return pPrograms;
}
示例5: GetProgramList
//.........这里部分代码省略.........
if (nChanId > 0)
{
sSQL += "AND program.chanid = :ChanId ";
bindings[":ChanId"] = nChanId;
}
if (dtStartTime.isNull())
dtStartTime = QDateTime::currentDateTimeUtc();
sSQL += " AND program.endtime >= :StartDate ";
bindings[":StartDate"] = dtStartTime;
if (!dtEndTime.isNull())
{
sSQL += "AND program.starttime <= :EndDate ";
bindings[":EndDate"] = dtEndTime;
}
if (!sTitleFilter.isEmpty())
{
sSQL += "AND program.title LIKE :Title ";
bindings[":Title"] = QString("%%1%").arg(sTitleFilter);
}
if (!sCategoryFilter.isEmpty())
{
sSQL += "AND program.category LIKE :Category ";
bindings[":Category"] = sCategoryFilter;
}
if (!sKeywordFilter.isEmpty())
{
sSQL += "AND (program.title LIKE :Keyword1 "
"OR program.subtitle LIKE :Keyword2 "
"OR program.description LIKE :Keyword3) ";
QString filter = QString("%%1%").arg(sKeywordFilter);
bindings[":Keyword1"] = filter;
bindings[":Keyword2"] = filter;
bindings[":Keyword3"] = filter;
}
if (sSort == "starttime")
sSQL += "ORDER BY program.starttime ";
else if (sSort == "title")
sSQL += "ORDER BY program.title ";
else if (sSort == "channel")
sSQL += "ORDER BY channel.channum ";
else if (sSort == "duration")
sSQL += "ORDER BY (program.endtime - program.starttime) ";
else
sSQL += "ORDER BY program.starttime ";
if (bDescending)
sSQL += "DESC ";
else
sSQL += "ASC ";
// ----------------------------------------------------------------------
// Get all Pending Scheduled Programs
// ----------------------------------------------------------------------
bool hasConflicts;
LoadFromScheduler(schedList, hasConflicts);
// ----------------------------------------------------------------------
uint nTotalAvailable = 0;
LoadFromProgram( progList, sSQL, bindings, schedList,
(uint)nStartIndex, (uint)nCount, nTotalAvailable);
// ----------------------------------------------------------------------
// Build Response
// ----------------------------------------------------------------------
DTC::ProgramList *pPrograms = new DTC::ProgramList();
nCount = (int)progList.size();
int nEndIndex = (int)progList.size();
for( int n = 0; n < nEndIndex; n++)
{
ProgramInfo *pInfo = progList[ n ];
DTC::Program *pProgram = pPrograms->AddNewProgram();
FillProgramInfo( pProgram, pInfo, true, bDetails, false ); // No cast info, loading this takes far too long
}
// ----------------------------------------------------------------------
pPrograms->setStartIndex ( nStartIndex );
pPrograms->setCount ( nCount );
pPrograms->setTotalAvailable( nTotalAvailable );
pPrograms->setAsOf ( MythDate::current() );
pPrograms->setVersion ( MYTH_BINARY_VERSION );
pPrograms->setProtoVer ( MYTH_PROTO_VERSION );
return pPrograms;
}
示例6: GetRecordedList
DTC::ProgramList* Dvr::GetRecordedList( bool bDescending,
int nStartIndex,
int nCount,
const QString &sTitleRegEx,
const QString &sRecGroup,
const QString &sStorageGroup )
{
QMap< QString, ProgramInfo* > recMap;
if (gCoreContext->GetScheduler())
recMap = gCoreContext->GetScheduler()->GetRecording();
QMap< QString, uint32_t > inUseMap = ProgramInfo::QueryInUseMap();
QMap< QString, bool > isJobRunning= ProgramInfo::QueryJobsRunning(JOB_COMMFLAG);
ProgramList progList;
int desc = 1;
if (bDescending)
desc = -1;
LoadFromRecorded( progList, false, inUseMap, isJobRunning, recMap, desc );
QMap< QString, ProgramInfo* >::iterator mit = recMap.begin();
for (; mit != recMap.end(); mit = recMap.erase(mit))
delete *mit;
// ----------------------------------------------------------------------
// Build Response
// ----------------------------------------------------------------------
DTC::ProgramList *pPrograms = new DTC::ProgramList();
int nAvailable = 0;
int nMax = (nCount > 0) ? nCount : progList.size();
nAvailable = 0;
nCount = 0;
QRegExp rTitleRegEx = QRegExp(sTitleRegEx, Qt::CaseInsensitive);
for( unsigned int n = 0; n < progList.size(); n++)
{
ProgramInfo *pInfo = progList[ n ];
if (pInfo->IsDeletePending() ||
(!sTitleRegEx.isEmpty() && !pInfo->GetTitle().contains(rTitleRegEx)) ||
(!sRecGroup.isEmpty() && sRecGroup != pInfo->GetRecordingGroup()) ||
(!sStorageGroup.isEmpty() && sStorageGroup != pInfo->GetStorageGroup()))
continue;
if ((nAvailable < nStartIndex) ||
(nCount >= nMax))
{
++nAvailable;
continue;
}
++nAvailable;
++nCount;
DTC::Program *pProgram = pPrograms->AddNewProgram();
FillProgramInfo( pProgram, pInfo, true );
}
// ----------------------------------------------------------------------
pPrograms->setStartIndex ( nStartIndex );
pPrograms->setCount ( nCount );
pPrograms->setTotalAvailable( nAvailable );
pPrograms->setAsOf ( MythDate::current() );
pPrograms->setVersion ( MYTH_BINARY_VERSION );
pPrograms->setProtoVer ( MYTH_PROTO_VERSION );
return pPrograms;
}