本文整理汇总了C++中ProgramInfo::MakeUniqueKey方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramInfo::MakeUniqueKey方法的具体用法?C++ ProgramInfo::MakeUniqueKey怎么用?C++ ProgramInfo::MakeUniqueKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramInfo
的用法示例。
在下文中一共展示了ProgramInfo::MakeUniqueKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendEvent
void PreviewGeneratorQueue::SendEvent(
const ProgramInfo &pginfo,
const QString &eventname,
const QString &fn, const QString &token, const QString &msg,
const QDateTime &dt)
{
QStringList list;
list.push_back(pginfo.MakeUniqueKey());
list.push_back(fn);
list.push_back(msg);
list.push_back(dt.toString(Qt::ISODate));
list.push_back(token);
QMutexLocker locker(&m_lock);
QSet<QObject*>::iterator it = m_listeners.begin();
for (; it != m_listeners.end(); ++it)
{
MythEvent *e = new MythEvent(eventname, list);
QCoreApplication::postEvent(*it, e);
}
}
示例2: lock
/**
* \brief Returns the recording we should switch to
*
* This returns a ProgramInfo* and tells us if this is a discontiuous
* switch and whether the recording type is changing.
*
* This also clears the NeedsToSwitch()/NeedsToJump() state.
*
* NOTE: The caller is resposible for deleting the ProgramInfo
*/
ProgramInfo *LiveTVChain::GetSwitchProgram(bool &discont, bool &newtype,
int &newid)
{
ReloadAll();
QMutexLocker lock(&m_lock);
if (m_switchid < 0 || m_curpos == m_switchid)
{
ClearSwitch();
return NULL;
}
LiveTVChainEntry oldentry, entry;
GetEntryAt(m_curpos, oldentry);
ProgramInfo *pginfo = NULL;
while (!pginfo && m_switchid < (int)m_chain.count() && m_switchid >= 0)
{
GetEntryAt(m_switchid, entry);
bool at_last_entry =
((m_switchid > m_curpos) &&
(m_switchid == (int)(m_chain.count()-1))) ||
((m_switchid <= m_curpos) && (m_switchid == 0));
// Skip dummy recordings, if possible.
if (at_last_entry || (entry.cardtype != "DUMMY"))
pginfo = EntryToProgram(entry);
// Skip empty recordings, if possible
if (pginfo && (0 == pginfo->GetFilesize()) &&
m_switchid < (int)(m_chain.count()-1))
{
LOG(VB_GENERAL, LOG_WARNING,
QString("Skipping empty program %1")
.arg(pginfo->MakeUniqueKey()));
delete pginfo;
pginfo = NULL;
}
if (!pginfo)
{
if (m_switchid > m_curpos)
m_switchid++;
else
m_switchid--;
}
}
if (!pginfo)
{
ClearSwitch();
return NULL;
}
discont = true;
if (m_curpos == m_switchid - 1)
discont = entry.discontinuity;
newtype = (oldentry.cardtype != entry.cardtype);
// Some cards can change their streams dramatically on a channel change...
if (discont)
newtype |= CardUtil::IsChannelChangeDiscontinuous(entry.cardtype);
newid = m_switchid;
ClearSwitch();
return pginfo;
}