本文整理汇总了C++中CDateTimeSpan::GetSecondsTotal方法的典型用法代码示例。如果您正苦于以下问题:C++ CDateTimeSpan::GetSecondsTotal方法的具体用法?C++ CDateTimeSpan::GetSecondsTotal怎么用?C++ CDateTimeSpan::GetSecondsTotal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDateTimeSpan
的用法示例。
在下文中一共展示了CDateTimeSpan::GetSecondsTotal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CanSystemPowerdown
bool CPVRManager::CanSystemPowerdown(bool bAskUser /*= true*/) const
{
bool bReturn(true);
if (IsStarted())
{
CPVRTimerInfoTagPtr cause;
if (!AllLocalBackendsIdle(cause))
{
if (bAskUser)
{
std::string text;
if (cause)
{
if (cause->IsRecording())
{
text = StringUtils::Format(g_localizeStrings.Get(19691).c_str(), // "PVR is currently recording...."
cause->Title().c_str(),
cause->ChannelName().c_str());
}
else
{
// Next event is due to a local recording.
const CDateTime now(CDateTime::GetUTCDateTime());
const CDateTime start(cause->StartAsUTC());
const CDateTimeSpan prestart(0, 0, cause->MarginStart(), 0);
CDateTimeSpan diff(start - now);
diff -= prestart;
int mins = diff.GetSecondsTotal() / 60;
std::string dueStr;
if (mins > 1)
{
// "%d minutes"
dueStr = StringUtils::Format(g_localizeStrings.Get(19694).c_str(), mins);
}
else
{
// "about a minute"
dueStr = g_localizeStrings.Get(19695);
}
text = StringUtils::Format(g_localizeStrings.Get(19692).c_str(), // "PVR will start recording...."
cause->Title().c_str(),
cause->ChannelName().c_str(),
dueStr.c_str());
}
}
else
{
// Next event is due to automatic daily wakeup of PVR.
const CDateTime now(CDateTime::GetUTCDateTime());
CDateTime dailywakeuptime;
dailywakeuptime.SetFromDBTime(CSettings::GetInstance().GetString(CSettings::SETTING_PVRPOWERMANAGEMENT_DAILYWAKEUPTIME));
dailywakeuptime = dailywakeuptime.GetAsUTCDateTime();
const CDateTimeSpan diff(dailywakeuptime - now);
int mins = diff.GetSecondsTotal() / 60;
std::string dueStr;
if (mins > 1)
{
// "%d minutes"
dueStr = StringUtils::Format(g_localizeStrings.Get(19694).c_str(), mins);
}
else
{
// "about a minute"
dueStr = g_localizeStrings.Get(19695);
}
text = StringUtils::Format(g_localizeStrings.Get(19693).c_str(), // "Daily wakeup is due in...."
dueStr.c_str());
}
// Inform user about PVR being busy. Ask if user wants to powerdown anyway.
bReturn = HELPERS::DialogResponse::YES ==
HELPERS::ShowYesNoDialogText(CVariant{19685}, // "Confirm shutdown"
CVariant{text},
CVariant{222}, // "Shutdown anyway",
CVariant{19696}, // "Cancel"
10000); // timeout value before closing
}
else
bReturn = false; // do not powerdown (busy, but no user interaction requested).
}
}
return bReturn;
}