本文整理汇总了C++中ProgramInfo::GetStorageGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramInfo::GetStorageGroup方法的具体用法?C++ ProgramInfo::GetStorageGroup怎么用?C++ ProgramInfo::GetStorageGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramInfo
的用法示例。
在下文中一共展示了ProgramInfo::GetStorageGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: QString
DTC::LiveStreamInfo *Content::AddRecordingLiveStream(
int nRecordedId,
int nChanId,
const QDateTime &recstarttsRaw,
int nMaxSegments,
int nWidth,
int nHeight,
int nBitrate,
int nAudioBitrate,
int nSampleRate )
{
if ((nRecordedId <= 0) &&
(nChanId <= 0 || !recstarttsRaw.isValid()))
throw QString("Recorded ID or Channel ID and StartTime appears invalid.");
// ------------------------------------------------------------------
// Read Recording From Database
// ------------------------------------------------------------------
// TODO Should use RecordingInfo
ProgramInfo pginfo;
if (nRecordedId > 0)
pginfo = ProgramInfo(nRecordedId);
else
pginfo = ProgramInfo(nChanId, recstarttsRaw.toUTC());
if (!pginfo.GetChanID())
{
LOG(VB_UPNP, LOG_ERR,
QString("AddRecordingLiveStream - for %1, %2 failed")
.arg(QString::number(nRecordedId)));
return NULL;
}
if (pginfo.GetHostname().toLower() != gCoreContext->GetHostName().toLower())
{
// We only handle requests for local resources
QString sMsg =
QString("GetRecording: Wrong Host '%1' request from '%2'.")
.arg( gCoreContext->GetHostName())
.arg( pginfo.GetHostname() );
LOG(VB_UPNP, LOG_ERR, sMsg);
throw HttpRedirectException( pginfo.GetHostname() );
}
QString sFileName( GetPlaybackURL(&pginfo) );
// ----------------------------------------------------------------------
// check to see if the file exists
// ----------------------------------------------------------------------
if (!QFile::exists( sFileName ))
{
LOG( VB_UPNP, LOG_ERR, QString("AddRecordingLiveStream - for %1, %2 failed")
.arg( nChanId )
.arg( recstarttsRaw.toUTC().toString() ));
return NULL;
}
QFileInfo fInfo( sFileName );
return AddLiveStream( pginfo.GetStorageGroup(), fInfo.fileName(),
pginfo.GetHostname(), nMaxSegments, nWidth,
nHeight, nBitrate, nAudioBitrate, nSampleRate );
}