本文整理汇总了C++中CPVRTimerInfoTagPtr::ChannelName方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRTimerInfoTagPtr::ChannelName方法的具体用法?C++ CPVRTimerInfoTagPtr::ChannelName怎么用?C++ CPVRTimerInfoTagPtr::ChannelName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRTimerInfoTagPtr
的用法示例。
在下文中一共展示了CPVRTimerInfoTagPtr::ChannelName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lock
void CPVRGUIInfo::TimerInfo::UpdateNextTimer()
{
std::string strNextRecordingTitle;
std::string strNextRecordingChannelName;
std::string strNextRecordingChannelIcon;
std::string strNextRecordingTime;
std::string strNextTimerInfo;
CFileItemPtr tag = GetNextActiveTimer();
if (tag && tag->HasPVRTimerInfoTag())
{
CPVRTimerInfoTagPtr timer = tag->GetPVRTimerInfoTag();
strNextRecordingTitle = StringUtils::Format("%s", timer->Title().c_str());
strNextRecordingChannelName = StringUtils::Format("%s", timer->ChannelName().c_str());
strNextRecordingChannelIcon = StringUtils::Format("%s", timer->ChannelIcon().c_str());
strNextRecordingTime = StringUtils::Format("%s", timer->StartAsLocalTime().GetAsLocalizedDateTime(false, false).c_str());
strNextTimerInfo = StringUtils::Format("%s %s %s %s",
g_localizeStrings.Get(19106).c_str(),
timer->StartAsLocalTime().GetAsLocalizedDate(true).c_str(),
g_localizeStrings.Get(19107).c_str(),
timer->StartAsLocalTime().GetAsLocalizedTime("HH:mm", false).c_str());
}
CSingleLock lock(m_critSection);
m_strNextRecordingTitle = strNextRecordingTitle;
m_strNextRecordingChannelName = strNextRecordingChannelName;
m_strNextRecordingChannelIcon = strNextRecordingChannelIcon;
m_strNextRecordingTime = strNextRecordingTime;
m_strNextTimerInfo = strNextTimerInfo;
}
示例2: 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;
}
示例3: GetListItemAndPlayerLabel
bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem *item, const CGUIInfo &info, std::string &strValue) const
{
const CPVRTimerInfoTagPtr timer = item->GetPVRTimerInfoTag();
if (timer)
{
switch (info.m_info)
{
case LISTITEM_DATE:
strValue = timer->Summary();
return true;
case LISTITEM_STARTDATE:
strValue = timer->StartAsLocalTime().GetAsLocalizedDate(true);
return true;
case LISTITEM_STARTTIME:
strValue = timer->StartAsLocalTime().GetAsLocalizedTime("", false);
return true;
case LISTITEM_ENDDATE:
strValue = timer->EndAsLocalTime().GetAsLocalizedDate(true);
return true;
case LISTITEM_ENDTIME:
strValue = timer->EndAsLocalTime().GetAsLocalizedTime("", false);
return true;
case LISTITEM_TITLE:
strValue = timer->Title();
return true;
case LISTITEM_COMMENT:
strValue = timer->GetStatus();
return true;
case LISTITEM_TIMERTYPE:
strValue = timer->GetTypeAsString();
return true;
case LISTITEM_CHANNEL_NAME:
strValue = timer->ChannelName();
return true;
case LISTITEM_EPG_EVENT_TITLE:
case LISTITEM_EPG_EVENT_ICON:
case LISTITEM_GENRE:
case LISTITEM_PLOT:
case LISTITEM_PLOT_OUTLINE:
case LISTITEM_DURATION:
case LISTITEM_ORIGINALTITLE:
case LISTITEM_YEAR:
case LISTITEM_SEASON:
case LISTITEM_EPISODE:
case LISTITEM_EPISODENAME:
case LISTITEM_DIRECTOR:
case LISTITEM_CHANNEL_NUMBER:
case LISTITEM_PREMIERED:
break; // obtain value from channel/epg
default:
return false;
}
}
const CPVRRecordingPtr recording(item->GetPVRRecordingInfoTag());
if (recording)
{
// Note: CPVRRecoding is derived from CVideoInfoTag. All base class properties will be handled
// by CVideoGUIInfoProvider. Only properties introduced by CPVRRecording need to be handled here.
switch (info.m_info)
{
case LISTITEM_DATE:
strValue = recording->RecordingTimeAsLocalTime().GetAsLocalizedDateTime(false, false);
return true;
case LISTITEM_STARTDATE:
strValue = recording->RecordingTimeAsLocalTime().GetAsLocalizedDate(true);
return true;
case VIDEOPLAYER_STARTTIME:
case LISTITEM_STARTTIME:
strValue = recording->RecordingTimeAsLocalTime().GetAsLocalizedTime("", false);
return true;
case LISTITEM_ENDDATE:
strValue = recording->EndTimeAsLocalTime().GetAsLocalizedDate(true);
return true;
case VIDEOPLAYER_ENDTIME:
case LISTITEM_ENDTIME:
strValue = recording->EndTimeAsLocalTime().GetAsLocalizedTime("", false);
return true;
case LISTITEM_EXPIRATION_DATE:
if (recording->HasExpirationTime())
{
strValue = recording->ExpirationTimeAsLocalTime().GetAsLocalizedDate(false);
return true;
}
break;
case LISTITEM_EXPIRATION_TIME:
if (recording->HasExpirationTime())
{
strValue = recording->ExpirationTimeAsLocalTime().GetAsLocalizedTime("", false);;
return true;
}
break;
case VIDEOPLAYER_EPISODENAME:
case LISTITEM_EPISODENAME:
strValue = recording->EpisodeName();
return true;
case VIDEOPLAYER_CHANNEL_NAME:
case LISTITEM_CHANNEL_NAME:
strValue = recording->m_strChannelName;
return true;
//.........这里部分代码省略.........