本文整理汇总了C++中CDateTime::GetSecond方法的典型用法代码示例。如果您正苦于以下问题:C++ CDateTime::GetSecond方法的具体用法?C++ CDateTime::GetSecond怎么用?C++ CDateTime::GetSecond使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDateTime
的用法示例。
在下文中一共展示了CDateTime::GetSecond方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetDateFromIndex
void CGUIDialogPVRTimerSettings::SetDateFromIndex(CDateTime &datetime, int date)
{
const CDateTime newDate(static_cast<time_t>(date));
datetime.SetDateTime(
newDate.GetYear(), newDate.GetMonth(), newDate.GetDay(),
datetime.GetHour(), datetime.GetMinute(), datetime.GetSecond());
}
示例2: GetNextEventTime
CDateTime CPVRTimers::GetNextEventTime(void) const
{
const bool dailywakup = CSettings::GetInstance().GetBool(CSettings::SETTING_PVRPOWERMANAGEMENT_DAILYWAKEUP);
const CDateTime now = CDateTime::GetUTCDateTime();
const CDateTimeSpan prewakeup(0, 0, CSettings::GetInstance().GetInt(CSettings::SETTING_PVRPOWERMANAGEMENT_PREWAKEUP), 0);
const CDateTimeSpan idle(0, 0, CSettings::GetInstance().GetInt(CSettings::SETTING_PVRPOWERMANAGEMENT_BACKENDIDLETIME), 0);
CDateTime wakeuptime;
/* Check next active time */
CFileItemPtr item = GetNextActiveTimer();
if (item && item->HasPVRTimerInfoTag())
{
const CDateTimeSpan prestart(0, 0, item->GetPVRTimerInfoTag()->MarginStart(), 0);
const CDateTime start = item->GetPVRTimerInfoTag()->StartAsUTC();
wakeuptime = ((start - prestart - prewakeup - idle) > now) ?
start - prestart - prewakeup :
now + idle;
}
/* check daily wake up */
if (dailywakup)
{
CDateTime dailywakeuptime;
dailywakeuptime.SetFromDBTime(CSettings::GetInstance().GetString(CSettings::SETTING_PVRPOWERMANAGEMENT_DAILYWAKEUPTIME));
dailywakeuptime = dailywakeuptime.GetAsUTCDateTime();
dailywakeuptime.SetDateTime(
now.GetYear(), now.GetMonth(), now.GetDay(),
dailywakeuptime.GetHour(), dailywakeuptime.GetMinute(), dailywakeuptime.GetSecond()
);
if ((dailywakeuptime - idle) < now)
{
const CDateTimeSpan oneDay(1,0,0,0);
dailywakeuptime += oneDay;
}
if (!wakeuptime.IsValid() || dailywakeuptime < wakeuptime)
wakeuptime = dailywakeuptime;
}
const CDateTime retVal(wakeuptime);
return retVal;
}
示例3: GetNextEventTime
CDateTime CPVRTimers::GetNextEventTime(void) const
{
const bool dailywakup = m_settings.GetBoolValue(CSettings::SETTING_PVRPOWERMANAGEMENT_DAILYWAKEUP);
const CDateTime now = CDateTime::GetUTCDateTime();
const CDateTimeSpan prewakeup(0, 0, m_settings.GetIntValue(CSettings::SETTING_PVRPOWERMANAGEMENT_PREWAKEUP), 0);
const CDateTimeSpan idle(0, 0, m_settings.GetIntValue(CSettings::SETTING_PVRPOWERMANAGEMENT_BACKENDIDLETIME), 0);
CDateTime wakeuptime;
/* Check next active time */
const std::shared_ptr<CPVRTimerInfoTag> timer = GetNextActiveTimer();
if (timer)
{
const CDateTimeSpan prestart(0, 0, timer->MarginStart(), 0);
const CDateTime start = timer->StartAsUTC();
wakeuptime = ((start - prestart - prewakeup - idle) > now) ?
start - prestart - prewakeup :
now + idle;
}
/* check daily wake up */
if (dailywakup)
{
CDateTime dailywakeuptime;
dailywakeuptime.SetFromDBTime(m_settings.GetStringValue(CSettings::SETTING_PVRPOWERMANAGEMENT_DAILYWAKEUPTIME));
dailywakeuptime = dailywakeuptime.GetAsUTCDateTime();
dailywakeuptime.SetDateTime(
now.GetYear(), now.GetMonth(), now.GetDay(),
dailywakeuptime.GetHour(), dailywakeuptime.GetMinute(), dailywakeuptime.GetSecond()
);
if ((dailywakeuptime - idle) < now)
{
const CDateTimeSpan oneDay(1,0,0,0);
dailywakeuptime += oneDay;
}
if (!wakeuptime.IsValid() || dailywakeuptime < wakeuptime)
wakeuptime = dailywakeuptime;
}
const CDateTime retVal(wakeuptime);
return retVal;
}
示例4: GetNextEventTime
CDateTime CPVRTimers::GetNextEventTime(void) const
{
const bool dailywakup = CSettings::Get().GetBool("pvrpowermanagement.dailywakeup");
const CDateTime now = CDateTime::GetUTCDateTime();
const CDateTimeSpan prewakeup(0, 0, CSettings::Get().GetInt("pvrpowermanagement.prewakeup"), 0);
const CDateTimeSpan idle(0, 0, CSettings::Get().GetInt("pvrpowermanagement.backendidletime"), 0);
CDateTime wakeuptime;
/* Check next active time */
CFileItemPtr item = GetNextActiveTimer();
if (item && item->HasPVRTimerInfoTag())
{
const CDateTimeSpan prestart(0, 0, item->GetPVRTimerInfoTag()->MarginStart(), 0);
const CDateTime start = item->GetPVRTimerInfoTag()->StartAsUTC();
wakeuptime = ((start - prestart - prewakeup - idle) > now) ?
start - prestart - prewakeup :
now + idle;
}
/* check daily wake up */
if (dailywakup)
{
CDateTime dailywakeuptime;
dailywakeuptime.SetFromDBTime(CSettings::Get().GetString("pvrpowermanagement.dailywakeuptime"));
dailywakeuptime = dailywakeuptime.GetAsUTCDateTime();
dailywakeuptime.SetDateTime(
now.GetYear(), now.GetMonth(), now.GetDay(),
dailywakeuptime.GetHour(), dailywakeuptime.GetMinute(), dailywakeuptime.GetSecond()
);
if ((dailywakeuptime - idle) < now)
{
const CDateTimeSpan oneDay(1,0,0,0);
dailywakeuptime += oneDay;
}
if (!wakeuptime.IsValid() || dailywakeuptime < wakeuptime)
wakeuptime = dailywakeuptime;
}
const CDateTime retVal(wakeuptime);
return retVal;
}
示例5: UpdateData
void CGUIWindowPVRGuide::UpdateData(void)
{
CPVRChannel CurrentChannel;
CPVRManager::Get()->GetCurrentChannel(&CurrentChannel);
m_bUpdateRequired = false;
m_parent->m_vecItems->Clear();
if (m_iGuideView == GUIDE_VIEW_CHANNEL)
{
m_parent->m_guideGrid = NULL;
m_parent->m_viewControl.SetCurrentView(CONTROL_LIST_GUIDE_CHANNEL);
m_parent->SetLabel(m_iControlButton, g_localizeStrings.Get(19029));
m_parent->SetLabel(CONTROL_LABELGROUP, CurrentChannel.ChannelName().c_str());
if (CurrentChannel.GetEPG(m_parent->m_vecItems) == 0)
{
CFileItemPtr item;
item.reset(new CFileItem("pvr://guide/" + CurrentChannel.ChannelName() + "/empty.epg", false));
item->SetLabel(g_localizeStrings.Get(19028));
item->SetLabelPreformated(true);
m_parent->m_vecItems->Add(item);
}
m_parent->m_viewControl.SetItems(*m_parent->m_vecItems);
}
else if (m_iGuideView == GUIDE_VIEW_NOW)
{
m_parent->m_guideGrid = NULL;
m_parent->m_viewControl.SetCurrentView(CONTROL_LIST_GUIDE_NOW_NEXT);
m_parent->SetLabel(m_iControlButton, g_localizeStrings.Get(19029) + ": " + g_localizeStrings.Get(19030));
m_parent->SetLabel(CONTROL_LABELGROUP, g_localizeStrings.Get(19030));
if (CPVRManager::GetEpg()->GetEPGNow(m_parent->m_vecItems, CurrentChannel.IsRadio()) == 0)
{
CFileItemPtr item;
item.reset(new CFileItem("pvr://guide/now/empty.epg", false));
item->SetLabel(g_localizeStrings.Get(19028));
item->SetLabelPreformated(true);
m_parent->m_vecItems->Add(item);
}
m_parent->m_viewControl.SetItems(*m_parent->m_vecItems);
}
else if (m_iGuideView == GUIDE_VIEW_NEXT)
{
m_parent->m_guideGrid = NULL;
m_parent->m_viewControl.SetCurrentView(CONTROL_LIST_GUIDE_NOW_NEXT);
m_parent->SetLabel(m_iControlButton, g_localizeStrings.Get(19029) + ": " + g_localizeStrings.Get(19031));
m_parent->SetLabel(CONTROL_LABELGROUP, g_localizeStrings.Get(19031));
if (CPVRManager::GetEpg()->GetEPGNext(m_parent->m_vecItems, CurrentChannel.IsRadio()) == 0)
{
CFileItemPtr item;
item.reset(new CFileItem("pvr://guide/next/empty.epg", false));
item->SetLabel(g_localizeStrings.Get(19028));
item->SetLabelPreformated(true);
m_parent->m_vecItems->Add(item);
}
m_parent->m_viewControl.SetItems(*m_parent->m_vecItems);
}
else if (m_iGuideView == GUIDE_VIEW_TIMELINE)
{
m_parent->SetLabel(m_iControlButton, g_localizeStrings.Get(19029) + ": " + g_localizeStrings.Get(19032));
m_parent->SetLabel(CONTROL_LABELGROUP, g_localizeStrings.Get(19032));
if (CPVRManager::GetEpg()->GetEPGAll(m_parent->m_vecItems, CurrentChannel.IsRadio()) > 0)
{
CDateTime now = CDateTime::GetCurrentDateTime();
CDateTime m_gridStart = now - CDateTimeSpan(0, 0, 0, (now.GetMinute() % 30) * 60 + now.GetSecond()) - CDateTimeSpan(0, g_guiSettings.GetInt("epg.lingertime") / 60, g_guiSettings.GetInt("epg.lingertime") % 60, 0);
CDateTime m_gridEnd = m_gridStart + CDateTimeSpan(g_guiSettings.GetInt("epg.daystodisplay"), 0, 0, 0);
m_parent->m_guideGrid = (CGUIEPGGridContainer*) m_parent->GetControl(CONTROL_LIST_TIMELINE);
if (m_parent->m_guideGrid)
{
m_parent->m_guideGrid->SetStartEnd(m_gridStart, m_gridEnd);
m_parent->m_viewControl.SetCurrentView(CONTROL_LIST_TIMELINE);
}
// m_viewControl.SetSelectedItem(m_iSelected_GUIDE);
}
}
m_parent->SetLabel(CONTROL_LABELHEADER, g_localizeStrings.Get(19029));
UpdateButtons();
}