本文整理汇总了C++中ProgramInfo类的典型用法代码示例。如果您正苦于以下问题:C++ ProgramInfo类的具体用法?C++ ProgramInfo怎么用?C++ ProgramInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProgramInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteRule
void ViewScheduled::deleteRule()
{
MythUIButtonListItem *item = m_schedulesList->GetItemCurrent();
if (!item)
return;
ProgramInfo *pginfo = qVariantValue<ProgramInfo*>(item->GetData());
if (!pginfo)
return;
RecordingRule *record = new RecordingRule();
if (!record->LoadByProgram(pginfo))
{
delete record;
return;
}
QString message = tr("Delete '%1' %2 rule?").arg(record->m_title)
.arg(toString(pginfo->GetRecordingRuleType()));
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *okPopup = new MythConfirmationDialog(popupStack,
message, true);
okPopup->SetReturnEvent(this, "deleterule");
okPopup->SetData(qVariantFromValue(record));
if (okPopup->Create())
popupStack->AddScreen(okPopup);
else
delete okPopup;
}
示例2: QString
bool Dvr::DeleteRecording(int RecordedId,
int chanid, const QDateTime &recstarttsRaw,
bool forceDelete, bool allowRerecord)
{
if ((RecordedId <= 0) &&
(chanid <= 0 || !recstarttsRaw.isValid()))
throw QString("Recorded ID or Channel ID and StartTime appears invalid.");
// TODO Should use RecordingInfo
ProgramInfo pi;
if (RecordedId > 0)
pi = ProgramInfo(RecordedId);
else
pi = ProgramInfo(chanid, recstarttsRaw.toUTC());
if (pi.GetChanID() && pi.HasPathname())
{
QString cmd = QString("DELETE_RECORDING %1 %2 %3 %4")
.arg(pi.GetChanID())
.arg(pi.GetRecordingStartTime(MythDate::ISODate))
.arg(forceDelete ? "FORCE" : "NO_FORCE")
.arg(allowRerecord ? "FORGET" : "NO_FORGET");
MythEvent me(cmd);
gCoreContext->dispatch(me);
return true;
}
return false;
}
示例3: extractDetailsFromFilename
ProgramInfo *getProgramInfoForFile(const QString &inFile)
{
ProgramInfo *pinfo = NULL;
QString chanID, startTime;
bool bIsMythRecording = false;
bIsMythRecording = extractDetailsFromFilename(inFile, chanID, startTime);
if (bIsMythRecording)
{
uint chanid = chanID.toUInt();
QDateTime recstartts = MythDate::fromString(startTime);
pinfo = new ProgramInfo(chanid, recstartts);
if (pinfo->GetChanID())
{
pinfo->SetPathname(pinfo->GetPlaybackURL(false, true));
}
else
{
delete pinfo;
pinfo = NULL;
}
}
if (!pinfo)
{
// file is not a myth recording or is no longer in the db
pinfo = new ProgramInfo(inFile);
LOG(VB_JOBQUEUE, LOG_NOTICE, "File is not a MythTV recording.");
}
else
LOG(VB_JOBQUEUE, LOG_NOTICE, "File is a MythTV recording.");
return pinfo;
}
示例4: getProgramInfoForFile
void ThumbFinder::loadCutList()
{
ProgramInfo *progInfo = getProgramInfoForFile(m_archiveItem->filename);
if (progInfo && m_archiveItem->hasCutlist)
{
progInfo->QueryCutList(m_deleteMap);
delete progInfo;
}
if (m_deleteMap.isEmpty())
{
LOG(VB_GENERAL, LOG_ERR, "ThumbFinder::loadCutList: Got an empty delete map");
return;
}
// if the first mark is a end mark then add the start mark at the beginning
frm_dir_map_t::const_iterator it = m_deleteMap.begin();
if (it.value() == MARK_CUT_END)
m_deleteMap.insert(0, MARK_CUT_START);
// if the last mark is a start mark then add the end mark at the end
it = m_deleteMap.end();
--it;
if (it != m_deleteMap.end())
{
if (it.value() == MARK_CUT_START)
m_deleteMap.insert(m_archiveItem->duration * m_fps, MARK_CUT_END);
}
}
示例5: clone
/// \brief Copies important fields from ProgramInfo
void RecordingInfo::clone(const ProgramInfo &other,
bool ignore_non_serialized_data)
{
bool is_same =
(chanid && recstartts.isValid() && startts.isValid() &&
chanid == other.GetChanID() &&
recstartts == other.GetRecordingStartTime() &&
startts == other.GetScheduledStartTime());
ProgramInfo::clone(other, ignore_non_serialized_data);
if (!is_same)
{
delete record;
record = NULL;
}
oldrecstatus = rsUnknown;
savedrecstatus = rsUnknown;
future = false;
schedorder = 0;
mplexid = 0;
desiredrecstartts = QDateTime();
desiredrecendts = QDateTime();
}
示例6: updateSelectedList
void RecordingSelector::updateSelectedList()
{
if (!m_recordingList)
return;
m_selectedList.clear();
ProgramInfo *p;
ArchiveItem *a;
for (int x = 0; x < m_archiveList->size(); x++)
{
a = m_archiveList->at(x);
for (uint y = 0; y < m_recordingList->size(); y++)
{
p = m_recordingList->at(y);
if (p->GetPlaybackURL(false, true) == a->filename)
{
if (m_selectedList.indexOf(p) == -1)
m_selectedList.append(p);
break;
}
qApp->processEvents();
}
}
}
示例7: GetPreviewImage
void PreviewGeneratorQueue::GetPreviewImage(
const ProgramInfo &pginfo,
const QSize &outputsize,
const QString &outputfile,
long long time, bool in_seconds,
QString token)
{
if (!s_pgq)
return;
if (pginfo.GetPathname().isEmpty() ||
pginfo.GetBasename() == pginfo.GetPathname())
{
return;
}
QStringList extra;
pginfo.ToStringList(extra);
extra += token;
extra += QString::number(outputsize.width());
extra += QString::number(outputsize.height());
extra += outputfile;
extra += QString::number(time);
extra += (in_seconds ? "1" : "0");
MythEvent *e = new MythEvent("GET_PREVIEW", extra);
QCoreApplication::postEvent(s_pgq, e);
}
示例8: MatchesRecording
/** \fn EncoderLink::MatchesRecording(const ProgramInfo *rec)
* \brief Returns true if rec is actually being recorded by TVRec.
*
* This waits for TVRec to enter a state other than kState_ChangingState
* Then it checks TVRec::GetRecording() against rec.
* \param rec Recording to check against TVRec::GetRecording().
* \sa IsRecording(const ProgramInfo*)
*/
bool EncoderLink::MatchesRecording(const ProgramInfo *rec)
{
bool retval = false;
ProgramInfo *tvrec = NULL;
if (local)
{
while (kState_ChangingState == GetState())
usleep(100);
if (IsBusyRecording())
tvrec = tv->GetRecording();
if (tvrec)
{
retval = tvrec->IsSameRecording(*rec);
delete tvrec;
}
}
else
{
if (HasSockAndIncrRef())
{
ReferenceLocker rlocker(sock);
retval = sock->EncoderIsRecording(m_capturecardnum, rec);
}
}
return retval;
}
示例9: GetCurrent
void ProgLister::ShowDeleteRuleMenu(void)
{
ProgramInfo *pi = GetCurrent();
if (!pi || !pi->GetRecordingRuleID())
return;
RecordingRule *record = new RecordingRule();
if (!record->LoadByProgram(pi))
{
delete record;
return;
}
QString message = tr("Delete '%1' %2 rule?").arg(record->m_title)
.arg(toString(pi->GetRecordingRuleType()));
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *okPopup = new MythConfirmationDialog(
popupStack, message, true);
okPopup->SetReturnEvent(this, "deleterule");
okPopup->SetData(qVariantFromValue(record));
if (okPopup->Create())
popupStack->AddScreen(okPopup);
else
delete okPopup;
}
示例10: RemoteGetRecordedList
void RecordingSelector::getRecordingList(void)
{
ProgramInfo *p;
m_recordingList = RemoteGetRecordedList(-1);
m_categories.clear();
if (m_recordingList && !m_recordingList->empty())
{
vector<ProgramInfo *>::iterator i = m_recordingList->begin();
for ( ; i != m_recordingList->end(); ++i)
{
p = *i;
// ignore live tv and deleted recordings
if (p->GetRecordingGroup() == "LiveTV" ||
p->GetRecordingGroup() == "Deleted")
{
i = m_recordingList->erase(i);
--i;
continue;
}
if (m_categories.indexOf(p->GetTitle()) == -1)
m_categories.append(p->GetTitle());
}
}
}
示例11: GetCurrentProgram
/**
* \brief Show the previous recordings for this recording rule
*/
void ScheduleCommon::ShowPrevious(void) const
{
ProgramInfo *pginfo = GetCurrentProgram();
if (!pginfo)
return;
ShowPrevious(pginfo->GetRecordingRuleID(), pginfo->GetTitle());
}
示例12: key
/** \brief Adds a ProgramInfo to the cache.
* \note This must only be called from the UI thread.
*/
void ProgramInfoCache::Add(const ProgramInfo &pginfo)
{
if (!pginfo.GetChanID() || Update(pginfo))
return;
PICKey key(pginfo.GetChanID(),pginfo.GetRecordingStartTime());
m_cache[key] = new ProgramInfo(pginfo);
}
示例13: SetProgram
void LiveTVChain::SetProgram(const ProgramInfo &pginfo)
{
QMutexLocker lock(&m_lock);
m_cur_chanid = pginfo.GetChanID();
m_cur_startts = pginfo.GetRecordingStartTime();
m_curpos = ProgramIsAt(pginfo);
m_switchid = -1;
}
示例14: ClearCurrentProgramInfo
void ProgLister::ClearCurrentProgramInfo(void)
{
InfoMap infoMap;
ProgramInfo pginfo;
pginfo.ToMap(infoMap);
ResetMap(infoMap);
if (m_positionText)
m_positionText->Reset();
}
示例15: getProgramInfoForFile
void ThumbFinder::loadCutList()
{
ProgramInfo *progInfo = getProgramInfoForFile(m_archiveItem->filename);
if (progInfo && m_archiveItem->hasCutlist)
{
progInfo->QueryCutList(m_deleteMap);
delete progInfo;
}
}