本文整理汇总了C++中CPVRTimerInfoTag::IsActive方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRTimerInfoTag::IsActive方法的具体用法?C++ CPVRTimerInfoTag::IsActive怎么用?C++ CPVRTimerInfoTag::IsActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRTimerInfoTag
的用法示例。
在下文中一共展示了CPVRTimerInfoTag::IsActive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnContextButtonActivate
bool CGUIWindowPVRTimers::OnContextButtonActivate(CFileItem *item, CONTEXT_BUTTON button)
{
bool bReturn = false;
if (button == CONTEXT_BUTTON_ACTIVATE)
{
bReturn = true;
if (!item->HasPVRTimerInfoTag())
return bReturn;
CPVRTimerInfoTag *timer = item->GetPVRTimerInfoTag();
int iLabelId;
if (timer->IsActive())
{
timer->m_state = PVR_TIMER_STATE_CANCELLED;
iLabelId = 13106;
}
else
{
timer->m_state = PVR_TIMER_STATE_SCHEDULED;
iLabelId = 305;
}
CGUIDialogOK::ShowAndGetInput(19033, 19040, 0, iLabelId);
g_PVRTimers->UpdateTimer(*item);
}
return bReturn;
}
示例2: GetNextActiveTimer
CFileItemPtr CPVRTimers::GetNextActiveTimer(void) const
{
CSingleLock lock(m_critSection);
for (map<CDateTime, vector<CPVRTimerInfoTag *>* >::const_iterator it = m_tags.begin(); it != m_tags.end(); it++)
{
for (unsigned int iTimerPtr = 0; iTimerPtr < it->second->size(); iTimerPtr++)
{
CPVRTimerInfoTag *current = it->second->at(iTimerPtr);
if (current->IsActive() && !current->IsRecording())
{
CFileItemPtr fileItem(new CFileItem(*current));
return fileItem;
}
}
}
CFileItemPtr fileItem;
return fileItem;
}
示例3: InitializeSettings
void CGUIDialogPVRTimerSettings::InitializeSettings()
{
CGUIDialogSettingsManualBase::InitializeSettings();
CSettingCategory *category = AddCategory("pvrtimersettings", -1);
if (category == NULL)
{
CLog::Log(LOGERROR, "CGUIDialogPVRTimerSettings: unable to setup settings");
return;
}
CSettingGroup *group = AddGroup(category);
if (group == NULL)
{
CLog::Log(LOGERROR, "CGUIDialogPVRTimerSettings: unable to setup settings");
return;
}
// add a condition
m_settingsManager->AddCondition("IsTimerDayRepeating", IsTimerDayRepeating);
CPVRTimerInfoTag* tag = m_timerItem->GetPVRTimerInfoTag();
m_selectedChannelEntry = 0;
m_channelEntries.clear();
m_bTimerActive = tag->IsActive();
AddToggle(group, SETTING_TMR_ACTIVE, 19074, 0, m_bTimerActive);
AddEdit(group, SETTING_TMR_NAME, 19075, 0, tag->m_strTitle, false, false, 19097);
if (tag->SupportsFolders())
AddEdit(group, SETTING_TMR_DIR, 19076, 0, tag->m_strDirectory, true, false, 19104);
AddToggle(group, SETTING_TMR_RADIO, 19077, 0, tag->m_bIsRadio);
/// Channel names
{
// For TV
AddChannelNames(group, false);
// For Radio
AddChannelNames(group, true);
}
/// Day
{
// get diffence of timer in days between today and timer start date
tm time_cur; CDateTime::GetCurrentDateTime().GetAsTm(time_cur);
tm time_tmr; tag->StartAsLocalTime().GetAsTm(time_tmr);
m_tmp_day += time_tmr.tm_yday - time_cur.tm_yday;
if (time_tmr.tm_yday - time_cur.tm_yday < 0)
m_tmp_day += 365;
SetWeekdaySettingFromTimer(*tag);
AddSpinner(group, SETTING_TMR_DAY, 19079, 0, m_tmp_day, DaysOptionsFiller);
}
AddButton(group, SETTING_TMR_BEGIN, 19080, 0);
AddButton(group, SETTING_TMR_END, 19081, 0);
AddSpinner(group, SETTING_TMR_PRIORITY, 19082, 0, tag->m_iPriority, 0, 1, 99);
AddSpinner(group, SETTING_TMR_LIFETIME, 19083, 0, tag->m_iLifetime, 0, 1, 365);
/// First day
{
CDateTime time = CDateTime::GetCurrentDateTime();
CDateTime timestart = tag->FirstDayAsLocalTime();
// get diffence of timer in days between today and timer start date
if (time < timestart)
{
tm time_cur; time.GetAsTm(time_cur);
tm time_tmr; timestart.GetAsTm(time_tmr);
m_tmp_iFirstDay += time_tmr.tm_yday - time_cur.tm_yday + 1;
if (time_tmr.tm_yday - time_cur.tm_yday < 0)
m_tmp_iFirstDay += 365;
}
CSettingInt *settingFirstDay = AddSpinner(group, SETTING_TMR_FIRST_DAY, 19084, 0, m_tmp_iFirstDay, DaysOptionsFiller);
// define an enable dependency with m_tmp_day <= 10
CSettingDependency depdendencyFirstDay(SettingDependencyTypeEnable, m_settingsManager);
depdendencyFirstDay.And()
->Add(CSettingDependencyConditionPtr(new CSettingDependencyCondition("IsTimerDayRepeating", "true", SETTING_TMR_DAY, false, m_settingsManager)));
SettingDependencies deps;
deps.push_back(depdendencyFirstDay);
settingFirstDay->SetDependencies(deps);
}
}
示例4: CreateSettings
void CGUIDialogPVRTimerSettings::CreateSettings()
{
CPVRTimerInfoTag* tag = m_timerItem->GetPVRTimerInfoTag();
// clear out any old settings
m_settings.clear();
// create our settings controls
m_bTimerActive = tag->IsActive();
AddBool(CONTROL_TMR_ACTIVE, 19074, &m_bTimerActive);
AddButton(CONTROL_TMR_NAME, 19075, &tag->m_strTitle, true);
if (tag->SupportsFolders())
AddButton(CONTROL_TMR_DIR, 19076, &tag->m_strDirectory, true);
AddBool(CONTROL_TMR_RADIO, 19077, &tag->m_bIsRadio);
/// Channel names
{
// For TV
CFileItemList channelslist_tv;
SETTINGSTRINGS channelstrings_tv;
AddChannelNames(channelslist_tv, channelstrings_tv, false);
// For Radio
CFileItemList channelslist_radio;
SETTINGSTRINGS channelstrings_radio;
AddChannelNames(channelslist_radio, channelstrings_radio, true);
}
/// Day
{
SETTINGSTRINGS daystrings;
tm time_cur;
tm time_tmr;
for (unsigned int iDayPtr = 19086; iDayPtr <= 19096; iDayPtr++)
daystrings.push_back(g_localizeStrings.Get(iDayPtr));
CDateTime time = CDateTime::GetCurrentDateTime();
CDateTime timestart = tag->StartAsLocalTime();
/* get diffence of timer in days between today and timer start date */
time.GetAsTm(time_cur);
timestart.GetAsTm(time_tmr);
m_tmp_day += time_tmr.tm_yday - time_cur.tm_yday;
if (time_tmr.tm_yday - time_cur.tm_yday < 0)
m_tmp_day += 365;
for (int i = 1; i < 365; ++i)
{
CStdString string = time.GetAsLocalizedDate();
daystrings.push_back(string);
time += CDateTimeSpan(1, 0, 0, 0);
}
SetWeekdaySettingFromTimer(*tag);
AddSpin(CONTROL_TMR_DAY, 19079, &m_tmp_day, daystrings.size(), daystrings);
}
AddButton(CONTROL_TMR_BEGIN, 19080, &timerStartTimeStr, true);
AddButton(CONTROL_TMR_END, 19081, &timerEndTimeStr, true);
AddSpin(CONTROL_TMR_PRIORITY, 19082, &tag->m_iPriority, 0, 99);
AddSpin(CONTROL_TMR_LIFETIME, 19083, &tag->m_iLifetime, 0, 365);
/// First day
{
SETTINGSTRINGS daystrings;
tm time_cur;
tm time_tmr;
CDateTime time = CDateTime::GetCurrentDateTime();
CDateTime timestart = tag->FirstDayAsLocalTime();
/* get diffence of timer in days between today and timer start date */
if (time < timestart)
{
time.GetAsTm(time_cur);
timestart.GetAsTm(time_tmr);
m_tmp_iFirstDay += time_tmr.tm_yday - time_cur.tm_yday + 1;
if (time_tmr.tm_yday - time_cur.tm_yday < 0)
m_tmp_iFirstDay += 365;
}
daystrings.push_back(g_localizeStrings.Get(19030));
for (int i = 1; i < 365; ++i)
{
CStdString string = time.GetAsLocalizedDate();
daystrings.push_back(string);
time += CDateTimeSpan(1, 0, 0, 0);
}
AddSpin(CONTROL_TMR_FIRST_DAY, 19084, &m_tmp_iFirstDay, daystrings.size(), daystrings);
if (tag->m_bIsRepeating)
EnableSettings(CONTROL_TMR_FIRST_DAY, true);
else
//.........这里部分代码省略.........