本文整理汇总了C++中MythTimer::SetDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ MythTimer::SetDescription方法的具体用法?C++ MythTimer::SetDescription怎么用?C++ MythTimer::SetDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythTimer
的用法示例。
在下文中一共展示了MythTimer::SetDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PVRtoMythTimer
void PVRClientMythTV::PVRtoMythTimer(const PVR_TIMER timer, MythTimer &mt)
{
CStdString category = m_categories.Category(timer.iGenreType);
mt.SetCategory(category);
mt.SetChannelID(timer.iClientChannelUid);
mt.SetCallsign(m_channels.at(timer.iClientChannelUid).Callsign());
mt.SetDescription(timer.strSummary);
mt.SetEndOffset(timer.iMarginEnd);
mt.SetEndTime(timer.endTime);
mt.SetInactive(timer.state == PVR_TIMER_STATE_ABORTED ||timer.state == PVR_TIMER_STATE_CANCELLED);
mt.SetPriority(timer.iPriority);
mt.SetStartOffset(timer.iMarginStart);
mt.SetStartTime(timer.startTime);
mt.SetTitle(timer.strTitle,true);
CStdString title = mt.Title(false);
mt.SetSearchType(m_db.FindProgram(timer.startTime, timer.iClientChannelUid, title, NULL) ? MythTimer::NoSearch : MythTimer::ManualSearch);
mt.SetType(timer.bIsRepeating ? (timer.iWeekdays == 127 ? MythTimer::TimeslotRecord : MythTimer::WeekslotRecord) : MythTimer::SingleRecord);
mt.SetRecordID(timer.iClientIndex);
}
示例2: AddTimer
PVR_ERROR PVRClientMythTV::AddTimer(const PVR_TIMER &timer)
{
if (g_bExtraDebug)
XBMC->Log(LOG_DEBUG, "%s - title: %s, start: %i, end: %i, chanID: %i", __FUNCTION__, timer.strTitle, timer.startTime, timer.iClientChannelUid);
MythTimer mt;
m_con.DefaultTimer(mt);
CStdString category = m_categories.Category(timer.iGenreType);
mt.SetCategory(category);
mt.SetChannelID(timer.iClientChannelUid);
mt.SetCallsign(m_channels.at(timer.iClientChannelUid).Callsign());
mt.SetDescription(timer.strSummary);
mt.SetEndOffset(timer.iMarginEnd);
mt.SetEndTime(timer.endTime);
mt.SetInactive(timer.state == PVR_TIMER_STATE_ABORTED ||timer.state == PVR_TIMER_STATE_CANCELLED);
mt.SetPriority(timer.iPriority);
mt.SetStartOffset(timer.iMarginStart);
mt.SetStartTime(timer.startTime);
mt.SetTitle(timer.strTitle, true);
CStdString title = mt.Title(false);
mt.SetSearchType(m_db.FindProgram(timer.startTime, timer.iClientChannelUid, title, NULL) ? MythTimer::NoSearch : MythTimer::ManualSearch);
mt.SetType(timer.bIsRepeating ? (timer.iWeekdays == 127 ? MythTimer::TimeslotRecord : MythTimer::WeekslotRecord) : MythTimer::SingleRecord);
int id = m_db.AddTimer(mt);
if (id<0)
return PVR_ERROR_FAILED;
if (!m_con.UpdateSchedules(id))
return PVR_ERROR_FAILED;
if (g_bExtraDebug)
XBMC->Log(LOG_DEBUG, "%s - Done - %i", __FUNCTION__, id);
// Completion of the scheduling will be signaled by a SCHEDULE_CHANGE event.
// Thus no need to call TriggerTimerUpdate().
return PVR_ERROR_NO_ERROR;
}
示例3: UpdateTimer
PVR_ERROR PVRClientMythTV::UpdateTimer(const PVR_TIMER &timer)
{
if (g_bExtraDebug)
XBMC->Log(LOG_DEBUG,"%s - title: %s, start: %i, end: %i, chanID: %i, ID: %i", __FUNCTION__, timer.strTitle, timer.startTime, timer.iClientChannelUid, timer.iClientIndex);
RecordingRule r = m_recordingRules[(timer.iClientIndex) >> 16];
PVR_TIMER oldPvrTimer = r[(timer.iClientIndex) & 0xffff].first;
{
bool createNewRule = false;
bool createNewOverrideRule = false;
MythTimer mt;
PVRtoMythTimer(timer, mt);
mt.SetDescription(oldPvrTimer.strSummary); // Fix broken description
mt.SetInactive(false);
mt.SetRecordID(r.RecordID());
// These should trigger a manual search or a new rule
if (oldPvrTimer.iClientChannelUid != timer.iClientChannelUid ||
oldPvrTimer.endTime != timer.endTime ||
oldPvrTimer.startTime != timer.startTime ||
oldPvrTimer.startTime != timer.startTime ||
strcmp(oldPvrTimer.strTitle, timer.strTitle) ||
//strcmp(oldPvrTimer.strSummary, timer.strSummary) ||
timer.bIsRepeating
)
createNewRule = true;
// Change type
if (oldPvrTimer.state != timer.state)
{
if (r.Type() != MythTimer::SingleRecord && !createNewRule)
{
if (timer.state == PVR_TIMER_STATE_ABORTED || timer.state == PVR_TIMER_STATE_CANCELLED)
mt.SetType(MythTimer::DontRecord);
else
mt.SetType(MythTimer::OverrideRecord);
createNewOverrideRule = true;
}
else
mt.SetInactive(timer.state == PVR_TIMER_STATE_ABORTED || timer.state == PVR_TIMER_STATE_CANCELLED);
}
// These can be updated without triggering a new rule
if (oldPvrTimer.iMarginEnd != timer.iMarginEnd ||
oldPvrTimer.iPriority != timer.iPriority ||
oldPvrTimer.iMarginStart != timer.iMarginStart)
createNewOverrideRule = true;
CStdString title = timer.strTitle;
if (createNewRule)
mt.SetSearchType(m_db.FindProgram(timer.startTime, timer.iClientChannelUid, title, NULL) ? MythTimer::NoSearch : MythTimer::ManualSearch);
if (createNewOverrideRule && r.SearchType() == MythTimer::ManualSearch)
mt.SetSearchType(MythTimer::ManualSearch);
if (r.Type() == MythTimer::DontRecord || r.Type() == MythTimer::OverrideRecord)
createNewOverrideRule = false;
if (createNewRule && r.Type() != MythTimer::SingleRecord)
{
if (!m_db.AddTimer(mt))
return PVR_ERROR_FAILED;
MythTimer mtold;
PVRtoMythTimer(oldPvrTimer, mtold);
mtold.SetType(MythTimer::DontRecord);
mtold.SetInactive(false);
mtold.SetRecordID(r.RecordID());
int id = r.RecordID();
if (r.Type() == MythTimer::DontRecord || r.Type() == MythTimer::OverrideRecord)
m_db.UpdateTimer(mtold);
else
id=m_db.AddTimer(mtold); // Blocks old record rule
m_con.UpdateSchedules(id);
}
else if (createNewOverrideRule && r.Type() != MythTimer::SingleRecord )
{
if (mt.Type() != MythTimer::DontRecord && mt.Type() != MythTimer::OverrideRecord)
mt.SetType(MythTimer::OverrideRecord);
if (!m_db.AddTimer(mt))
return PVR_ERROR_FAILED;
}
else
{
if (!m_db.UpdateTimer(mt))
return PVR_ERROR_FAILED;
}
m_con.UpdateSchedules(mt.RecordID());
}
if (g_bExtraDebug)
XBMC->Log(LOG_DEBUG,"%s - Done", __FUNCTION__);
return PVR_ERROR_NO_ERROR;
}